├── .gitignore ├── Images ├── MainPage.PNG └── DateFormatOptions.PNG ├── SecondHand ├── Assets.xcassets │ ├── Contents.json │ ├── AppIcon.appiconset │ │ ├── SecondHand-3.png │ │ └── Contents.json │ └── AccentColor.colorset │ │ └── Contents.json ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── StatusMagic │ ├── iOS14 │ │ ├── StatusSetter14.h │ │ └── StatusSetter14.m │ ├── iOS15 │ │ ├── StatusSetter15.h │ │ └── StatusSetter15.m │ ├── iOS16 │ │ ├── StatusSetter16.h │ │ └── StatusSetter16.m │ ├── iOS16_1 │ │ ├── StatusSetter16_1.h │ │ └── StatusSetter16_1.m │ └── MainFunctions │ │ ├── StatusSetter.h │ │ ├── StatusManager.h │ │ └── StatusManager.m ├── SecondHand-Bridging-Header.h ├── Extensions │ ├── String++.swift │ ├── Bundle++.swift │ └── Alert++.swift ├── Info.plist ├── Controllers │ ├── BackgroundFileUpdaterController.swift │ ├── ApplicationMonitor.swift │ └── LocationManager.swift ├── SecondHand.entitlements ├── App │ ├── AppDelegate.swift │ └── SecondHandApp.swift └── ContentView.swift ├── SecondHand.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcuserdata │ └── lemin.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── project.pbxproj ├── README.md ├── ipabuild.sh └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | SecondHand.tipa 3 | -------------------------------------------------------------------------------- /Images/MainPage.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leminlimez/SecondHand/HEAD/Images/MainPage.PNG -------------------------------------------------------------------------------- /Images/DateFormatOptions.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leminlimez/SecondHand/HEAD/Images/DateFormatOptions.PNG -------------------------------------------------------------------------------- /SecondHand/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SecondHand/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/iOS14/StatusSetter14.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #import "StatusSetter.h" 3 | 4 | @interface StatusSetter14 : NSObject 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/iOS15/StatusSetter15.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #import "StatusSetter.h" 3 | 4 | @interface StatusSetter15 : NSObject 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/iOS16/StatusSetter16.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #import "StatusSetter.h" 3 | 4 | @interface StatusSetter16 : NSObject 5 | 6 | @end 7 | 8 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/iOS16_1/StatusSetter16_1.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #import "StatusSetter.h" 3 | 4 | @interface StatusSetter16_1 : NSObject 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /SecondHand/Assets.xcassets/AppIcon.appiconset/SecondHand-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leminlimez/SecondHand/HEAD/SecondHand/Assets.xcassets/AppIcon.appiconset/SecondHand-3.png -------------------------------------------------------------------------------- /SecondHand/SecondHand-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "StatusManager.h" 6 | -------------------------------------------------------------------------------- /SecondHand.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SecondHand/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SecondHand/Extensions/String++.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String.swift 3 | // Evyrest 4 | // 5 | // Created by exerhythm on 14.12.2022. 6 | // 7 | 8 | import Foundation 9 | 10 | extension String: LocalizedError { 11 | public var errorDescription: String? { return self } 12 | } 13 | -------------------------------------------------------------------------------- /SecondHand.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SecondHand/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "SecondHand-3.png", 5 | "idiom" : "universal", 6 | "platform" : "ios", 7 | "size" : "1024x1024" 8 | } 9 | ], 10 | "info" : { 11 | "author" : "xcode", 12 | "version" : 1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SecondHand/Extensions/Bundle++.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Bundle++.swift 3 | // SecondHand 4 | // 5 | // Created by lemin on 3/10/23. 6 | // 7 | 8 | import Foundation 9 | 10 | extension Bundle { 11 | var releaseVersionNumber: String? { 12 | return infoDictionary?["CFBundleShortVersionString"] as? String 13 | } 14 | var buildVersionNumber: String? { 15 | return infoDictionary?["CFBundleVersion"] as? String 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecondHand.xcodeproj/xcuserdata/lemin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SecondHand.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SecondHand/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSLocationWhenInUseUsageDescription 6 | SecondHand runs in background to keep the time changing. Usually iOS kills such apps after a period of time. But Cowabunga tricks iOS by requesting location data thus allowiing much longer sessions. Data is never stored anywhere, only fetched. 7 | NSLocationAlwaysAndWhenInUseUsageDescription 8 | SecondHand runs in background to keep the time changing. Usually iOS kills such apps after a period of time. But Cowabunga tricks iOS by requesting location data thus allowiing much longer sessions. Data is never stored anywhere, only fetched. 9 | UIBackgroundModes 10 | 11 | location 12 | processing 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SecondHand 2 | Add seconds and date to status bar clock on [TrollStore](https://github.com/opa334/TrollStore) devices 3 | Compatible with iOS 14.0-15.4.1 4 | 5 | In order for it to run in the background, you must set location services to **Always**, and you can enable notifications so that you can be notified when the app stops running. 6 | No information will leave your device. It is only to keep the app open. 7 | 8 | **Info:** Your battery life may be impacted. From my personal experience, it uses less than one percent but that may vary. 9 | 10 | I am not responsible for damage to your device. 11 | 12 | ## Screenshots 13 | 14 | 15 | 16 | ## Credits 17 | - Avangelista and [StatusMagic](https://github.com/Avangelista/StatusMagic) for status bar method. 18 | - [Evyrest](https://github.com/sourcelocation/Evyrest) for background updating. 19 | - [grant_full_disk_access](https://gist.github.com/zhuowei/bc7a90bdc520556fda84d33e0583eb3e) 20 | - [Ian Beer](https://twitter.com/i41nbeer) for MacDirtyCow exploit code. 21 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/MainFunctions/StatusSetter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #import 3 | 4 | @protocol StatusSetter 5 | - (bool) isCarrierOverridden; 6 | - (NSString*) getCarrierOverride; 7 | - (void) setCarrier:(NSString*)text; 8 | - (void) unsetCarrier; 9 | - (bool) isTimeOverridden; 10 | - (NSString*) getTimeOverride; 11 | - (void) setTime:(NSString*)text; 12 | - (void) unsetTime; 13 | - (bool) isCrumbOverridden; 14 | - (NSString*) getCrumbOverride; 15 | - (void) setCrumb:(NSString*)text; 16 | - (void) unsetCrumb; 17 | - (bool) isClockHidden; 18 | - (void) hideClock:(bool)hidden; 19 | - (bool) isDNDHidden; 20 | - (void) hideDND:(bool)hidden; 21 | - (bool) isAirplaneHidden; 22 | - (void) hideAirplane:(bool)hidden; 23 | - (bool) isCellHidden; 24 | - (void) hideCell:(bool)hidden; 25 | - (bool) isWiFiHidden; 26 | - (void) hideWiFi:(bool)hidden; 27 | - (bool) isBatteryHidden; 28 | - (void) hideBattery:(bool)hidden; 29 | - (bool) isBluetoothHidden; 30 | - (void) hideBluetooth:(bool)hidden; 31 | - (bool) isAlarmHidden; 32 | - (void) hideAlarm:(bool)hidden; 33 | - (bool) isLocationHidden; 34 | - (void) hideLocation:(bool)hidden; 35 | - (bool) isRotationHidden; 36 | - (void) hideRotation:(bool)hidden; 37 | - (bool) isAirPlayHidden; 38 | - (void) hideAirPlay:(bool)hidden; 39 | - (bool) isCarPlayHidden; 40 | - (void) hideCarPlay:(bool)hidden; 41 | - (bool) isVPNHidden; 42 | - (void) hideVPN:(bool)hidden; 43 | - (bool) isMicrophoneUseHidden; 44 | - (void) hideMicrophoneUse:(bool)hidden; 45 | - (bool) isCameraUseHidden; 46 | - (void) hideCameraUse:(bool)hidden; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /ipabuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")" 6 | 7 | WORKING_LOCATION="$(pwd)" 8 | APPLICATION_NAME=SecondHand 9 | CONFIGURATION=Debug 10 | 11 | if [ -e "$APPLICATION_NAME.tipa" ]; then 12 | rm "$APPLICATION_NAME.tipa" 13 | fi 14 | if [ ! -d "build" ]; then 15 | mkdir build 16 | fi 17 | cd build 18 | 19 | # Build .app for iOS 14 min 20 | xcodebuild -project "$WORKING_LOCATION/$APPLICATION_NAME.xcodeproj" \ 21 | -scheme $APPLICATION_NAME \ 22 | -configuration Debug \ 23 | -derivedDataPath "$WORKING_LOCATION/build/DerivedData" \ 24 | -destination 'generic/platform=iOS' \ 25 | ONLY_ACTIVE_ARCH="NO" \ 26 | CODE_SIGNING_ALLOWED="NO" \ 27 | 28 | DD_APP_PATH="$WORKING_LOCATION/build/DerivedData/Build/Products/$CONFIGURATION-iphoneos/$APPLICATION_NAME.app" 29 | TARGET_APP="$WORKING_LOCATION/build/$APPLICATION_NAME.app" 30 | cp -r "$DD_APP_PATH" "$TARGET_APP" 31 | 32 | # Remove signature 33 | codesign --remove "$TARGET_APP" 34 | if [ -e "$TARGET_APP/_CodeSignature" ]; then 35 | rm -rf "$TARGET_APP/_CodeSignature" 36 | fi 37 | if [ -e "$TARGET_APP/embedded.mobileprovision" ]; then 38 | rm -rf "$TARGET_APP/embedded.mobileprovision" 39 | fi 40 | 41 | # Add entitlements 42 | echo "Adding entitlements" 43 | ldid -S"$WORKING_LOCATION/$APPLICATION_NAME/$APPLICATION_NAME.entitlements" "$TARGET_APP/$APPLICATION_NAME" 44 | 45 | # Package .ipa 46 | rm -rf Payload 47 | mkdir Payload 48 | cp -r $APPLICATION_NAME.app Payload/$APPLICATION_NAME.app 49 | zip -vr "$APPLICATION_NAME.tipa" Payload 50 | rm -rf $APPLICATION_NAME.app 51 | rm -rf Payload 52 | rm -rf DerivedData 53 | mv "$APPLICATION_NAME.tipa" "../$APPLICATION_NAME.tipa" 54 | cd .. 55 | rm -rf build 56 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/MainFunctions/StatusManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #import 3 | 4 | @interface StatusManager : NSObject 5 | 6 | + (StatusManager *)sharedInstance; 7 | - (bool)isMDCMode; 8 | - (void)setIsMDCMode:(bool)mode; 9 | - (bool) isCarrierOverridden; 10 | - (NSString*) getCarrierOverride; 11 | - (void) setCarrier:(NSString*)text; 12 | - (void) unsetCarrier; 13 | - (bool) isTimeOverridden; 14 | - (NSString*) getTimeOverride; 15 | - (void) setTime:(NSString*)text; 16 | - (void) unsetTime; 17 | - (bool) isCrumbOverridden; 18 | - (NSString*) getCrumbOverride; 19 | - (void) setCrumb:(NSString*)text; 20 | - (void) unsetCrumb; 21 | - (bool) isClockHidden; 22 | - (void) hideClock:(bool)hidden; 23 | - (bool) isDNDHidden; 24 | - (void) hideDND:(bool)hidden; 25 | - (bool) isAirplaneHidden; 26 | - (void) hideAirplane:(bool)hidden; 27 | - (bool) isCellHidden; 28 | - (void) hideCell:(bool)hidden; 29 | - (bool) isWiFiHidden; 30 | - (void) hideWiFi:(bool)hidden; 31 | - (bool) isBatteryHidden; 32 | - (void) hideBattery:(bool)hidden; 33 | - (bool) isBluetoothHidden; 34 | - (void) hideBluetooth:(bool)hidden; 35 | - (bool) isAlarmHidden; 36 | - (void) hideAlarm:(bool)hidden; 37 | - (bool) isLocationHidden; 38 | - (void) hideLocation:(bool)hidden; 39 | - (bool) isRotationHidden; 40 | - (void) hideRotation:(bool)hidden; 41 | - (bool) isAirPlayHidden; 42 | - (void) hideAirPlay:(bool)hidden; 43 | - (bool) isCarPlayHidden; 44 | - (void) hideCarPlay:(bool)hidden; 45 | - (bool) isVPNHidden; 46 | - (void) hideVPN:(bool)hidden; 47 | - (bool) isMicrophoneUseHidden; 48 | - (void) hideMicrophoneUse:(bool)hidden; 49 | - (bool) isCameraUseHidden; 50 | - (void) hideCameraUse:(bool)hidden; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /SecondHand/Controllers/BackgroundFileUpdaterController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BackgroundFileUpdaterController.swift 3 | // Cowabunga 4 | // 5 | // Created by lemin on 1/17/23. 6 | // 7 | 8 | // credits to sourcelocation and Evyrest 9 | 10 | import Foundation 11 | import SwiftUI 12 | import notify 13 | import SystemConfiguration 14 | import Combine 15 | 16 | struct BackgroundOption: Identifiable { 17 | var id = UUID() 18 | var key: String 19 | var title: String 20 | var enabled: Bool = true 21 | } 22 | 23 | class BackgroundFileUpdaterController: ObservableObject { 24 | static let shared = BackgroundFileUpdaterController() 25 | public var time = 3600.0 26 | public var timer: Timer? = nil 27 | 28 | func setup() { 29 | startTimer() 30 | } 31 | 32 | func startTimer() { 33 | guard timer == nil else { return } 34 | 35 | timer = Timer.scheduledTimer(withTimeInterval: time, repeats: true) { timer in 36 | BackgroundFileUpdaterController.shared.updateTime() 37 | } 38 | } 39 | 40 | func stopTimer() { 41 | timer?.invalidate() 42 | timer = nil 43 | } 44 | 45 | func restartTimer() { 46 | stopTimer() 47 | startTimer() 48 | } 49 | 50 | func stop() { 51 | // lol 52 | } 53 | 54 | func updateTime() { 55 | Task { 56 | // apply to the timer 57 | if UserDefaults.standard.bool(forKey: "TimeIsEnabled") == true { 58 | setTimeSeconds() 59 | } 60 | 61 | // apply to breadcrumb 62 | if UserDefaults.standard.bool(forKey: "DateIsEnabled") == true { 63 | setCrumbDate() 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /SecondHand/SecondHand.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.UIKit.status-bar-override-allow 6 | 7 | get-task-allow 8 | 9 | platform-application 10 | 11 | com.apple.security.iokit-user-client-class 12 | 13 | AGXDeviceUserClient 14 | IOHDIXControllerUserClient 15 | IOSurfaceRootUserClient 16 | 17 | com.apple.security.exception.files.absolute-path.read-write 18 | 19 | / 20 | 21 | com.apple.mobile.deleted.AllowFreeSpace 22 | 23 | com.apple.private.security.container-manager 24 | 25 | com.apple.private.security.no-container 26 | 27 | com.apple.private.security.no-sandbox 28 | 29 | com.apple.private.persona-mgmt 30 | 31 | com.apple.private.WebClips.read-write 32 | 33 | com.apple.locationd.simulation 34 | 35 | com.apple.SystemConfiguration.SCDynamicStore-write-access 36 | 37 | com.apple.private.security.system-application 38 | 39 | com.apple.private.coreservices.canmaplsdatabase 40 | 41 | com.apple.lsapplicationworkspace.rebuildappdatabases 42 | 43 | com.apple.private.MobileContainerManager.allowed 44 | 45 | com.apple.private.MobileInstallationHelperService.InstallDaemonOpsEnabled 46 | 47 | com.apple.private.MobileInstallationHelperService.allowed 48 | 49 | com.apple.private.uninstall.deletion 50 | 51 | com.apple.private.security.storage.MobileDocuments 52 | 53 | com.apple.managedconfiguration.profiled-access 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /SecondHand/Extensions/Alert++.swift: -------------------------------------------------------------------------------- 1 | // Created by sourcelocation on 14.12.2022. 2 | 3 | import UIKit 4 | 5 | var currentUIAlertController: UIAlertController? 6 | 7 | extension UIApplication { 8 | func dismissAlert(animated: Bool) { 9 | DispatchQueue.main.async { 10 | currentUIAlertController?.dismiss(animated: animated) 11 | } 12 | } 13 | func alert(title: String = "Error", body: String, animated: Bool = true, withButton: Bool = true) { 14 | DispatchQueue.main.async { 15 | currentUIAlertController = UIAlertController(title: title, message: body, preferredStyle: .alert) 16 | if withButton { currentUIAlertController?.addAction(.init(title: "OK", style: .cancel)) } 17 | self.present(alert: currentUIAlertController!) 18 | } 19 | } 20 | func confirmAlert(title: String = "Error", body: String, onOK: @escaping () -> (), noCancel: Bool = false) { 21 | DispatchQueue.main.async { 22 | currentUIAlertController = UIAlertController(title: title, message: body, preferredStyle: .alert) 23 | if !noCancel { 24 | currentUIAlertController?.addAction(.init(title: "No", style: .cancel)) 25 | } 26 | currentUIAlertController?.addAction(.init(title: "Yes", style: noCancel ? .cancel : .default, handler: { _ in 27 | onOK() 28 | })) 29 | self.present(alert: currentUIAlertController!) 30 | } 31 | } 32 | func change(title: String = "Error", body: String) { 33 | DispatchQueue.main.async { 34 | currentUIAlertController?.title = title 35 | currentUIAlertController?.message = body 36 | } 37 | } 38 | 39 | func present(alert: UIAlertController) { 40 | if var topController = self.windows.first?.rootViewController { 41 | while let presentedViewController = topController.presentedViewController { 42 | topController = presentedViewController 43 | } 44 | 45 | topController.present(alert, animated: true) 46 | // topController should now be your topmost view controller 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /SecondHand/App/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Cowabunga 4 | // 5 | // Created by lemin on 1/17/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | extension UNNotificationCategory 11 | { 12 | static let clipboardReaderIdentifier = "SecondHandClock" 13 | } 14 | 15 | class AppDelegate: UIResponder, UIApplicationDelegate { 16 | 17 | var window: UIWindow? 18 | 19 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 20 | UserDefaults.standard.set(DateFormatter.dateFormat(fromTemplate: "j", options: 0, locale: Locale.current)?.range(of: "a") == nil, forKey: "Time24Hour") 21 | UserDefaults.standard.set("MM/dd", forKey: "DateFormat") 22 | ApplicationMonitor.shared.start() 23 | 24 | self.registerForNotifications() 25 | 26 | return true 27 | } 28 | 29 | } 30 | 31 | extension AppDelegate: UNUserNotificationCenterDelegate { 32 | private func registerForNotifications() { 33 | let category = UNNotificationCategory(identifier: UNNotificationCategory.clipboardReaderIdentifier, actions: [], intentIdentifiers: []) 34 | UNUserNotificationCenter.current().setNotificationCategories([category]) 35 | 36 | UNUserNotificationCenter.current().delegate = self 37 | UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (success, error) in } 38 | } 39 | 40 | func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { 41 | completionHandler(.banner) 42 | } 43 | 44 | func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { 45 | guard response.notification.request.content.categoryIdentifier == UNNotificationCategory.clipboardReaderIdentifier else { return } 46 | guard response.actionIdentifier == UNNotificationDefaultActionIdentifier else { return } 47 | print(response) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /SecondHand/App/SecondHandApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SecondHandApp.swift 3 | // SecondHand 4 | // 5 | // Created by lemin on 3/2/23. 6 | // 7 | 8 | import SwiftUI 9 | import Darwin 10 | 11 | @main 12 | struct SecondHandApp: App { 13 | @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate 14 | 15 | var body: some Scene { 16 | WindowGroup { 17 | ContentView().onAppear { 18 | checkAndEscape() 19 | 20 | // credit: TrollTools 21 | if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String, let url = URL(string: "https://api.github.com/repos/leminlimez/SecondHand/releases/latest") { 22 | let task = URLSession.shared.dataTask(with: url) {(data, response, error) in 23 | guard let data = data else { return } 24 | 25 | if let json = try? JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String: Any] { 26 | if (json["tag_name"] as? String)?.compare(version, options: .numeric) == .orderedDescending { 27 | UIApplication.shared.confirmAlert(title: "Update available", body: "SecondHand version \(json["tag_name"] as? String ?? "update") is available, do you want to visit releases page?", onOK: { 28 | UIApplication.shared.open(URL(string: "https://github.com/leminlimez/SecondHand/releases/latest")!) 29 | }, noCancel: false) 30 | } 31 | } 32 | } 33 | task.resume() 34 | } 35 | } 36 | } 37 | } 38 | 39 | func checkAndEscape() { 40 | #if targetEnvironment(simulator) 41 | StatusManager.sharedInstance().setIsMDCMode(false) 42 | #else 43 | if #available(iOS 15.6.1, *) { 44 | // check permissions 45 | do { 46 | try FileManager.default.contentsOfDirectory(atPath: "/var/mobile") 47 | return 48 | } catch { 49 | UIApplication.shared.alert(title: "Not Supported", body: "This version of iOS is not supported. Please close the app.", withButton: false) 50 | } 51 | } else { 52 | getRootFS() 53 | } 54 | #endif 55 | } 56 | 57 | func getRootFS() { 58 | do { 59 | // Check if application is entitled 60 | try FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: "/var/mobile"), includingPropertiesForKeys: nil) 61 | if UserDefaults.standard.bool(forKey: "ForceMDC") { 62 | throw "Forced MDC" 63 | } else { 64 | StatusManager.sharedInstance().setIsMDCMode(false) 65 | } 66 | } catch { 67 | UIApplication.shared.alert(title: "Use TrollStore", body: "You must install this app with TrollStore for it to work. Please close the app.", withButton: false) 68 | return 69 | } 70 | 71 | let fm = FileManager.default 72 | if fm.fileExists(atPath: "/var/mobile/Library/SpringBoard/statusBarOverridesEditing") { 73 | do { 74 | try fm.removeItem(at: URL(fileURLWithPath: "/var/mobile/Library/SpringBoard/statusBarOverridesEditing")) 75 | } catch { 76 | UIApplication.shared.alert(body: "\(error)") 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /SecondHand/Controllers/ApplicationMonitor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ApplicationMonitor.swift 3 | // Clip 4 | // 5 | // Created by Riley Testut on 6/27/19. 6 | // Copyright © 2019 Riley Testut. All rights reserved. 7 | // 8 | import UIKit 9 | import AVFoundation 10 | import UserNotifications 11 | import Combine 12 | 13 | private enum UserNotification: String 14 | { 15 | case appStoppedRunning = "com.rileytestut.Clip.AppStoppedRunning" 16 | } 17 | 18 | private extension CFNotificationName 19 | { 20 | static let altstoreRequestAppState: CFNotificationName = CFNotificationName("com.altstore.RequestAppState.com.rileytestut.Clip" as CFString) 21 | static let altstoreAppIsRunning: CFNotificationName = CFNotificationName("com.altstore.AppState.Running.com.rileytestut.Clip" as CFString) 22 | } 23 | 24 | private let ReceivedApplicationState: @convention(c) (CFNotificationCenter?, UnsafeMutableRawPointer?, CFNotificationName?, UnsafeRawPointer?, CFDictionary?) -> Void = 25 | { (center, observer, name, object, userInfo) in 26 | ApplicationMonitor.shared.receivedApplicationStateRequest() 27 | } 28 | 29 | class ApplicationMonitor 30 | { 31 | static let shared = ApplicationMonitor() 32 | 33 | let locationManager = LocationManager() 34 | 35 | private(set) var isMonitoring = false 36 | 37 | private var backgroundTaskID: UIBackgroundTaskIdentifier? 38 | } 39 | 40 | extension ApplicationMonitor 41 | { 42 | func start() 43 | { 44 | guard !self.isMonitoring else { return } 45 | self.isMonitoring = true 46 | 47 | self.cancelApplicationQuitNotification() // Cancel any notifications from a previous launch. 48 | self.scheduleApplicationQuitNotification() 49 | 50 | self.locationManager.start() 51 | self.registerForNotifications() 52 | } 53 | 54 | func stop() { 55 | self.cancelApplicationQuitNotification() 56 | } 57 | } 58 | 59 | private extension ApplicationMonitor 60 | { 61 | func registerForNotifications() 62 | { 63 | let center = CFNotificationCenterGetDarwinNotifyCenter() 64 | CFNotificationCenterAddObserver(center, nil, ReceivedApplicationState, CFNotificationName.altstoreRequestAppState.rawValue, nil, .deliverImmediately) 65 | } 66 | 67 | func scheduleApplicationQuitNotification() 68 | { 69 | let delay = 5 as TimeInterval 70 | 71 | let content = UNMutableNotificationContent() 72 | content.title = NSLocalizedString("App Stopped Running", comment: "") 73 | content.body = NSLocalizedString("Tap this notification to resume tweak applications.", comment: "") 74 | 75 | let trigger = UNTimeIntervalNotificationTrigger(timeInterval: delay + 1, repeats: false) 76 | 77 | let request = UNNotificationRequest(identifier: UserNotification.appStoppedRunning.rawValue, content: content, trigger: trigger) 78 | UNUserNotificationCenter.current().add(request) 79 | 80 | DispatchQueue.global().asyncAfter(deadline: .now() + delay) { 81 | // If app is still running at this point, we schedule another notification with same identifier. 82 | // This prevents the currently scheduled notification from displaying, and starts another countdown timer. 83 | self.scheduleApplicationQuitNotification() 84 | } 85 | } 86 | 87 | func cancelApplicationQuitNotification() 88 | { 89 | UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [UserNotification.appStoppedRunning.rawValue]) 90 | } 91 | 92 | func sendNotification(title: String, message: String) 93 | { 94 | let content = UNMutableNotificationContent() 95 | content.title = title 96 | content.body = message 97 | 98 | let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil) 99 | UNUserNotificationCenter.current().add(request) 100 | } 101 | } 102 | 103 | private extension ApplicationMonitor 104 | { 105 | func receivedApplicationStateRequest() 106 | { 107 | guard UIApplication.shared.applicationState != .background else { return } 108 | 109 | let center = CFNotificationCenterGetDarwinNotifyCenter() 110 | CFNotificationCenterPostNotification(center!, CFNotificationName(CFNotificationName.altstoreAppIsRunning.rawValue), nil, nil, true) 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /SecondHand/Controllers/LocationManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LocationManager.swift 3 | // Clip 4 | // 5 | // Created by Riley Testut on 11/6/20. 6 | // Copyright © 2020 Riley Testut. All rights reserved. 7 | // 8 | 9 | // taken from https://github.com/rileytestut/Clip. many thanks 10 | 11 | import CoreLocation 12 | import Combine 13 | import UIKit 14 | 15 | extension LocationManager 16 | { 17 | typealias Status = Result 18 | 19 | enum Error: LocalizedError, RecoverableError 20 | { 21 | case requiresAlwaysAuthorization 22 | 23 | var failureReason: String? { 24 | switch self 25 | { 26 | case .requiresAlwaysAuthorization: return NSLocalizedString("SecondHand requires “Always” location permission.", comment: "") 27 | } 28 | } 29 | 30 | var recoverySuggestion: String? { 31 | switch self 32 | { 33 | case .requiresAlwaysAuthorization: return NSLocalizedString("Please grant SecondHand “Always” location permission in Settings so it can run in the background indefinitely.", comment: "") 34 | } 35 | } 36 | 37 | var recoveryOptions: [String] { 38 | switch self 39 | { 40 | case .requiresAlwaysAuthorization: return [NSLocalizedString("Open Settings", comment: "")] 41 | } 42 | } 43 | 44 | func attemptRecovery(optionIndex recoveryOptionIndex: Int) -> Bool 45 | { 46 | return false 47 | } 48 | 49 | func attemptRecovery(optionIndex recoveryOptionIndex: Int, resultHandler handler: @escaping (Bool) -> Void) 50 | { 51 | switch self 52 | { 53 | case .requiresAlwaysAuthorization: 54 | let openURL = URL(string: UIApplication.openSettingsURLString)! 55 | UIApplication.shared.open(openURL, options: [:], completionHandler: handler) 56 | } 57 | } 58 | } 59 | } 60 | 61 | class LocationManager: NSObject, ObservableObject 62 | { 63 | var status: Status? = nil 64 | 65 | private let locationManager: CLLocationManager 66 | 67 | override init() 68 | { 69 | self.locationManager = CLLocationManager() 70 | self.locationManager.distanceFilter = CLLocationDistanceMax 71 | self.locationManager.pausesLocationUpdatesAutomatically = false 72 | self.locationManager.allowsBackgroundLocationUpdates = true 73 | 74 | if #available(iOS 14.0, *) 75 | { 76 | self.locationManager.desiredAccuracy = kCLLocationAccuracyReduced 77 | } 78 | else 79 | { 80 | self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers 81 | } 82 | 83 | super.init() 84 | 85 | self.locationManager.delegate = self 86 | } 87 | 88 | func start() 89 | { 90 | switch self.status 91 | { 92 | case .success: return 93 | case .failure, nil: break 94 | } 95 | 96 | if locationManager.authorizationStatus == .notDetermined || locationManager.authorizationStatus == .authorizedWhenInUse 97 | { 98 | self.locationManager.requestAlwaysAuthorization() 99 | return 100 | } 101 | 102 | self.locationManager.startUpdatingLocation() 103 | } 104 | 105 | func stop() 106 | { 107 | self.locationManager.stopUpdatingLocation() 108 | self.status = nil 109 | } 110 | } 111 | 112 | 113 | extension LocationManager: CLLocationManagerDelegate 114 | { 115 | func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) 116 | { 117 | switch status 118 | { 119 | case .notDetermined: break 120 | case .restricted, .denied, .authorizedWhenInUse: self.status = .failure(Error.requiresAlwaysAuthorization) 121 | case .authorizedAlways: self.start() 122 | @unknown default: break 123 | } 124 | } 125 | 126 | func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) 127 | { 128 | self.status = .success(()) 129 | } 130 | 131 | func locationManager(_ manager: CLLocationManager, didFailWithError error: Swift.Error) 132 | { 133 | if let error = error as? CLError 134 | { 135 | guard error.code != .denied else { 136 | self.status = .failure(Error.requiresAlwaysAuthorization) 137 | return 138 | } 139 | } 140 | 141 | self.status = .failure(error) 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/MainFunctions/StatusManager.m: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------- 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Shiny Development 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // -------------------------------------------------------------------------------- 24 | 25 | #import 26 | #import 27 | //#import 28 | #import "StatusManager.h" 29 | #import "StatusSetter.h" 30 | #import "StatusSetter16_1.h" 31 | #import "StatusSetter16.h" 32 | #import "StatusSetter15.h" 33 | #import "StatusSetter14.h" 34 | 35 | @interface StatusManager () 36 | @property (nonatomic, strong) id setter; 37 | @property (nonatomic) bool MDCMode; 38 | 39 | @end 40 | 41 | @implementation StatusManager 42 | 43 | - (instancetype)init { 44 | self = [super init]; 45 | return self; 46 | } 47 | 48 | - (id)setter { 49 | if (!_setter) { 50 | if (@available(iOS 16.1, *)) { 51 | if ([[NSUserDefaults standardUserDefaults] boolForKey:@"UseAlternativeSetter"]) { 52 | _setter = [StatusSetter16 new]; 53 | } else { 54 | _setter = [StatusSetter16_1 new]; 55 | } 56 | } else if (@available(iOS 16, *)) { 57 | _setter = [StatusSetter16 new]; 58 | } else if (@available(iOS 15, *)) { 59 | _setter = [StatusSetter15 new]; 60 | } else if (@available(iOS 14, *)) { 61 | _setter = [StatusSetter14 new]; 62 | } 63 | } 64 | return _setter; 65 | } 66 | 67 | - (bool) isMDCMode { 68 | return self.MDCMode; 69 | } 70 | 71 | /// Set whether we're using MacDirtyCOW or not 72 | - (void) setIsMDCMode:(bool)mode { 73 | self.MDCMode = mode; 74 | } 75 | 76 | + (StatusManager *)sharedInstance { 77 | static dispatch_once_t predicate = 0; 78 | __strong static id sharedObject = nil; 79 | dispatch_once(&predicate, ^{ sharedObject = [[self alloc] init]; }); 80 | return sharedObject; 81 | } 82 | 83 | - (bool) isCarrierOverridden { 84 | return [self.setter isCarrierOverridden]; 85 | } 86 | 87 | - (NSString*) getCarrierOverride { 88 | return [self.setter getCarrierOverride]; 89 | } 90 | 91 | - (void) setCarrier:(NSString*)text { 92 | [self.setter setCarrier:text]; 93 | } 94 | 95 | - (void) unsetCarrier { 96 | [self.setter unsetCarrier]; 97 | } 98 | 99 | - (bool) isTimeOverridden { 100 | return [self.setter isTimeOverridden]; 101 | } 102 | 103 | - (NSString*) getTimeOverride { 104 | return [self.setter getTimeOverride]; 105 | } 106 | 107 | - (void) setTime:(NSString*)text { 108 | [self.setter setTime:text]; 109 | } 110 | 111 | - (void) unsetTime { 112 | [self.setter unsetTime]; 113 | } 114 | 115 | - (bool) isCrumbOverridden { 116 | return [self.setter isCrumbOverridden]; 117 | } 118 | 119 | - (NSString*) getCrumbOverride { 120 | return [self.setter getCrumbOverride]; 121 | } 122 | 123 | - (void) setCrumb:(NSString*)text { 124 | [self.setter setCrumb:text]; 125 | } 126 | 127 | - (void) unsetCrumb { 128 | [self.setter unsetCrumb]; 129 | } 130 | 131 | - (bool) isClockHidden { 132 | return [self.setter isClockHidden]; 133 | } 134 | 135 | - (void) hideClock:(bool)hidden { 136 | [self.setter hideClock:hidden]; 137 | } 138 | 139 | - (bool) isDNDHidden { 140 | return [self.setter isDNDHidden]; 141 | } 142 | 143 | - (void) hideDND:(bool)hidden { 144 | [self.setter hideDND:hidden]; 145 | } 146 | 147 | - (bool) isAirplaneHidden { 148 | return [self.setter isAirplaneHidden]; 149 | } 150 | 151 | - (void) hideAirplane:(bool)hidden { 152 | [self.setter hideAirplane:hidden]; 153 | } 154 | 155 | - (bool) isCellHidden { 156 | return [self.setter isCellHidden]; 157 | } 158 | 159 | - (void) hideCell:(bool)hidden { 160 | [self.setter hideCell:hidden]; 161 | } 162 | 163 | - (bool) isWiFiHidden { 164 | return [self.setter isWiFiHidden]; 165 | } 166 | 167 | - (void) hideWiFi:(bool)hidden { 168 | [self.setter hideWiFi:hidden]; 169 | } 170 | 171 | - (bool) isBatteryHidden { 172 | return [self.setter isBatteryHidden]; 173 | } 174 | 175 | - (void) hideBattery:(bool)hidden { 176 | [self.setter hideBattery:hidden]; 177 | } 178 | 179 | - (bool) isBluetoothHidden { 180 | return [self.setter isBluetoothHidden]; 181 | } 182 | 183 | - (void) hideBluetooth:(bool)hidden { 184 | [self.setter hideBluetooth:hidden]; 185 | } 186 | 187 | - (bool) isAlarmHidden { 188 | return [self.setter isAlarmHidden]; 189 | } 190 | 191 | - (void) hideAlarm:(bool)hidden { 192 | [self.setter hideAlarm:hidden]; 193 | } 194 | 195 | - (bool) isLocationHidden { 196 | return [self.setter isLocationHidden]; 197 | } 198 | 199 | - (void) hideLocation:(bool)hidden { 200 | [self.setter hideLocation:hidden]; 201 | } 202 | 203 | - (bool) isRotationHidden { 204 | return [self.setter isRotationHidden]; 205 | } 206 | 207 | - (void) hideRotation:(bool)hidden { 208 | [self.setter hideRotation:hidden]; 209 | } 210 | 211 | - (bool) isAirPlayHidden { 212 | return [self.setter isAirPlayHidden]; 213 | } 214 | 215 | - (void) hideAirPlay:(bool)hidden { 216 | [self.setter hideAirPlay:hidden]; 217 | } 218 | 219 | - (bool) isCarPlayHidden { 220 | return [self.setter isCarPlayHidden]; 221 | } 222 | 223 | - (void) hideCarPlay:(bool)hidden { 224 | [self.setter hideCarPlay:hidden]; 225 | } 226 | 227 | - (bool) isVPNHidden { 228 | return [self.setter isVPNHidden]; 229 | } 230 | 231 | - (void) hideVPN:(bool)hidden { 232 | [self.setter hideVPN:hidden]; 233 | } 234 | 235 | - (bool) isMicrophoneUseHidden { 236 | return [self.setter isMicrophoneUseHidden]; 237 | } 238 | 239 | - (void) hideMicrophoneUse:(bool)hidden { 240 | [self.setter hideMicrophoneUse:hidden]; 241 | } 242 | 243 | - (bool) isCameraUseHidden { 244 | return [self.setter isCameraUseHidden]; 245 | } 246 | 247 | - (void) hideCameraUse:(bool)hidden { 248 | [self.setter hideCameraUse:hidden]; 249 | } 250 | 251 | @end 252 | -------------------------------------------------------------------------------- /SecondHand/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // SecondHand 4 | // 5 | // Created by lemin on 3/2/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | func setTimeSeconds() { 11 | let calendar = Calendar.current 12 | let date = Date() 13 | let hour = calendar.component(.hour, from: date) 14 | let hourFinal = UserDefaults.standard.bool(forKey: "Time24Hour") ? hour : (hour%12 == 0 ? 12 : hour%12) 15 | let minutes = calendar.component(.minute, from: date) 16 | let seconds = calendar.component(.second, from: date) 17 | 18 | let newStr: String = "\(hourFinal):\(String(format: "%02d", minutes)):\(String(format: "%02d", seconds))" 19 | 20 | if newStr.utf8CString.count <= 64 { 21 | StatusManager.sharedInstance().setTime(newStr) 22 | } else { 23 | StatusManager.sharedInstance().setTime("Length Error") 24 | } 25 | } 26 | 27 | func setCrumbDate() { 28 | let dateFormatter = DateFormatter() 29 | dateFormatter.dateFormat = UserDefaults.standard.string(forKey: "DateFormat") ?? "MM/dd" 30 | 31 | let newStr: String = dateFormatter.string(from: Date()) 32 | 33 | if (newStr + " ▶").utf8CString.count <= 256 { 34 | StatusManager.sharedInstance().setCrumb(newStr) 35 | } else { 36 | StatusManager.sharedInstance().setCrumb("Length Error") 37 | } 38 | } 39 | 40 | struct ContentView: View { 41 | @State private var timeTextEnabled: Bool = StatusManager.sharedInstance().isTimeOverridden() 42 | @State private var crumbTextEnabled: Bool = StatusManager.sharedInstance().isCrumbOverridden() 43 | @State private var dateFormat: String = UserDefaults.standard.string(forKey: "DateFormat") ?? "MM/dd" 44 | 45 | private var dateFormats: [String] = [ 46 | "MM/dd", 47 | "MM/dd/yyyy", 48 | "MMM dd", 49 | "MMM dd yyyy", 50 | 51 | "dd/MM", 52 | "dd/MM/yyyy", 53 | "dd MMM", 54 | "dd MMM yyyy", 55 | 56 | "EEE, MMM dd", 57 | "EEEE" 58 | ] 59 | 60 | private var dateFormattingExamples: [String: String] = [ 61 | "MM/dd": "03/20", 62 | "MM/dd/yyyy": "03/20/2023", 63 | "MMM dd": "Mar 20", 64 | "MMM dd yyyy": "Mar 20 2023", 65 | 66 | "dd/MM": "20/03", 67 | "dd/MM/yyyy": "20/03/2023", 68 | "dd MMM": "20 Mar", 69 | "dd MMM yyyy": "20 Mar 2023", 70 | 71 | "EEE, MMM dd": "Mon, Mar 20", 72 | "EEEE": "Monday" 73 | ] 74 | 75 | //@State private var timeAs24: Bool = UserDefaults.standard.bool(forKey: "Time24Hour") 76 | 77 | @ObservedObject var backgroundController = BackgroundFileUpdaterController.shared 78 | 79 | @State var test: String = "" 80 | 81 | var body: some View { 82 | ZStack { 83 | VStack { 84 | Text(timeTextEnabled || crumbTextEnabled ? "Running" : "Stopped") 85 | .foregroundColor(timeTextEnabled || crumbTextEnabled ? .green : .red) 86 | .font(.title2) 87 | .padding(20) 88 | 89 | // MARK: Configuration 90 | // MARK: 24-Hour Time 91 | // Toggle("24 Hour Time", isOn: $timeAs24).onChange(of: timeAs24) { new in 92 | // UserDefaults.standard.set(new, forKey: "Time24Hour") 93 | // } 94 | 95 | // MARK: Seconds 96 | Toggle("Seconds", isOn: $timeTextEnabled).onChange(of: timeTextEnabled) { new in 97 | if new { 98 | UserDefaults.standard.set(true, forKey: "TimeIsEnabled") 99 | setTimeSeconds() 100 | backgroundController.time = 1.0 101 | backgroundController.restartTimer() 102 | timeTextEnabled = StatusManager.sharedInstance().isTimeOverridden() 103 | } else { 104 | UserDefaults.standard.set(false, forKey: "TimeIsEnabled") 105 | backgroundController.time = 3600.0 106 | backgroundController.restartTimer() 107 | StatusManager.sharedInstance().unsetTime() 108 | timeTextEnabled = StatusManager.sharedInstance().isTimeOverridden() 109 | } 110 | } 111 | .padding(10) 112 | 113 | Divider() 114 | 115 | // MARK: Date 116 | Toggle("Date", isOn: $crumbTextEnabled).onChange(of: crumbTextEnabled) { new in 117 | if new { 118 | UserDefaults.standard.set(true, forKey: "DateIsEnabled") 119 | setCrumbDate() 120 | crumbTextEnabled = StatusManager.sharedInstance().isCrumbOverridden() 121 | } else { 122 | UserDefaults.standard.set(false, forKey: "DateIsEnabled") 123 | StatusManager.sharedInstance().unsetCrumb() 124 | crumbTextEnabled = StatusManager.sharedInstance().isCrumbOverridden() 125 | } 126 | } 127 | .padding(10) 128 | 129 | // MARK: Date Format 130 | HStack { 131 | Text("Date Format") 132 | .bold() 133 | Spacer() 134 | Button(action: { 135 | showDateFormatPopup() 136 | }) { 137 | Text(dateFormat) 138 | .foregroundColor(.blue) 139 | } 140 | } 141 | .padding(10) 142 | } 143 | .padding() 144 | 145 | VStack { 146 | Spacer() 147 | Text("Version \(Bundle.main.releaseVersionNumber ?? "UNKNOWN")") 148 | .font(.footnote) 149 | .foregroundColor(.secondary) 150 | } 151 | } 152 | .onAppear { 153 | if UserDefaults.standard.bool(forKey: "TimeIsEnabled") == true { 154 | // check if it was disabled elsewhere 155 | UserDefaults.standard.set(timeTextEnabled, forKey: "TimeIsEnabled") 156 | if timeTextEnabled == true { 157 | backgroundController.time = 1.0 158 | } 159 | } 160 | 161 | if UserDefaults.standard.bool(forKey: "DateIsEnabled") == true { 162 | // check if it was disabled elsewhere 163 | UserDefaults.standard.set(crumbTextEnabled, forKey: "DateIsEnabled") 164 | } 165 | 166 | backgroundController.setup() 167 | } 168 | } 169 | 170 | func showDateFormatPopup() { 171 | // create and configure alert controller 172 | let alert = UIAlertController(title: "Choose a date format", message: "", preferredStyle: .actionSheet) 173 | 174 | // create the actions 175 | for f in dateFormats { 176 | let newAction = UIAlertAction(title: "\(f) (\(dateFormattingExamples[f] ?? "Error"))", style: .default) { (action) in 177 | // apply the format 178 | UserDefaults.standard.set(f, forKey: "DateFormat") 179 | dateFormat = f 180 | if crumbTextEnabled { 181 | setCrumbDate() 182 | } 183 | } 184 | if dateFormat == f { 185 | // add a check mark 186 | newAction.setValue(true, forKey: "checked") 187 | } 188 | alert.addAction(newAction) 189 | } 190 | 191 | let cancelAction = UIAlertAction(title: NSLocalizedString("Cancel", comment: ""), style: .cancel) { (action) in 192 | // cancels the action 193 | } 194 | 195 | // add the actions 196 | alert.addAction(cancelAction) 197 | 198 | let view: UIView = UIApplication.shared.windows.first!.rootViewController!.view 199 | // present popover for iPads 200 | alert.popoverPresentationController?.sourceView = view // prevents crashing on iPads 201 | alert.popoverPresentationController?.sourceRect = CGRect(x: view.bounds.midX, y: view.bounds.maxY, width: 0, height: 0) // show up at center bottom on iPads 202 | 203 | // present the alert 204 | UIApplication.shared.windows.first?.rootViewController?.present(alert, animated: true) 205 | } 206 | } 207 | 208 | struct ContentView_Previews: PreviewProvider { 209 | static var previews: some View { 210 | ContentView() 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/iOS14/StatusSetter14.m: -------------------------------------------------------------------------------- 1 | #import "StatusSetter14.h" 2 | #import "StatusManager.h" 3 | 4 | typedef NS_ENUM(int, StatusBarItem) { 5 | TimeStatusBarItem = 0, 6 | DateStatusBarItem = 1, 7 | QuietModeStatusBarItem = 2, 8 | AirplaneModeStatusBarItem = 3, 9 | CellularSignalStrengthStatusBarItem = 4, 10 | SecondaryCellularSignalStrengthStatusBarItem = 5, 11 | CellularServiceStatusBarItem = 6, 12 | SecondaryCellularServiceStatusBarItem = 7, 13 | // 8 14 | CellularDataNetworkStatusBarItem = 9, 15 | SecondaryCellularDataNetworkStatusBarItem = 10, 16 | // 11 17 | MainBatteryStatusBarItem = 12, 18 | ProminentlyShowBatteryDetailStatusBarItem = 13, 19 | // 14 20 | // 15 21 | BluetoothStatusBarItem = 16, 22 | TTYStatusBarItem = 17, 23 | AlarmStatusBarItem = 18, 24 | // 19 25 | // 20 26 | LocationStatusBarItem = 21, 27 | RotationLockStatusBarItem = 22, 28 | CameraUseStatusBarItem = 23, 29 | AirPlayStatusBarItem = 24, 30 | AssistantStatusBarItem = 25, 31 | CarPlayStatusBarItem = 26, 32 | StudentStatusBarItem = 27, 33 | MicrophoneUseStatusBarItem = 28, 34 | VPNStatusBarItem = 29, 35 | // 30 36 | // 31 37 | // 32 38 | // 33 39 | // 34 40 | // 35 41 | // 36 42 | // 37 43 | LiquidDetectionStatusBarItem = 38, 44 | VoiceControlStatusBarItem = 39, 45 | // 40 46 | // 41 47 | }; 48 | 49 | typedef NS_ENUM(unsigned int, BatteryState) { 50 | BatteryStateUnplugged = 0 51 | }; 52 | 53 | typedef struct { 54 | bool itemIsEnabled[43]; 55 | char timeString[64]; 56 | char shortTimeString[64]; 57 | char dateString[256]; 58 | int gsmSignalStrengthRaw; 59 | int secondaryGsmSignalStrengthRaw; 60 | int gsmSignalStrengthBars; 61 | int secondaryGsmSignalStrengthBars; 62 | char serviceString[100]; 63 | char secondaryServiceString[100]; 64 | char serviceCrossfadeString[100]; 65 | char secondaryServiceCrossfadeString[100]; 66 | char serviceImages[2][100]; 67 | char operatorDirectory[1024]; 68 | unsigned int serviceContentType; 69 | unsigned int secondaryServiceContentType; 70 | unsigned int cellLowDataModeActive:1; 71 | unsigned int secondaryCellLowDataModeActive:1; 72 | int wifiSignalStrengthRaw; 73 | int wifiSignalStrengthBars; 74 | unsigned int wifiLowDataModeActive:1; 75 | unsigned int dataNetworkType; 76 | unsigned int secondaryDataNetworkType; 77 | int batteryCapacity; 78 | unsigned int batteryState; 79 | char batteryDetailString[150]; 80 | int bluetoothBatteryCapacity; 81 | int thermalColor; 82 | unsigned int thermalSunlightMode : 1; 83 | unsigned int slowActivity : 1; 84 | unsigned int syncActivity : 1; 85 | char activityDisplayId[256]; 86 | unsigned int bluetoothConnected : 1; 87 | unsigned int displayRawGSMSignal : 1; 88 | unsigned int displayRawWifiSignal : 1; 89 | unsigned int locationIconType : 1; 90 | unsigned int voiceControlIconType:2; 91 | unsigned int quietModeInactive : 1; 92 | unsigned int tetheringConnectionCount; 93 | unsigned int batterySaverModeActive : 1; 94 | unsigned int deviceIsRTL : 1; 95 | unsigned int lock : 1; 96 | char breadcrumbTitle[256]; 97 | char breadcrumbSecondaryTitle[256]; 98 | char personName[100]; 99 | unsigned int electronicTollCollectionAvailable : 1; 100 | unsigned int radarAvailable : 1; 101 | unsigned int wifiLinkWarning : 1; 102 | unsigned int wifiSearching : 1; 103 | double backgroundActivityDisplayStartDate; 104 | unsigned int shouldShowEmergencyOnlyStatus : 1; 105 | unsigned int secondaryCellularConfigured : 1; 106 | char primaryServiceBadgeString[100]; 107 | char secondaryServiceBadgeString[100]; 108 | } StatusBarRawData; 109 | 110 | typedef struct { 111 | bool overrideItemIsEnabled[43]; 112 | unsigned int overrideTimeString : 1; 113 | unsigned int overrideDateString : 1; 114 | unsigned int overrideGsmSignalStrengthRaw : 1; 115 | unsigned int overrideSecondaryGsmSignalStrengthRaw : 1; 116 | unsigned int overrideGsmSignalStrengthBars : 1; 117 | unsigned int overrideSecondaryGsmSignalStrengthBars : 1; 118 | unsigned int overrideServiceString : 1; 119 | unsigned int overrideSecondaryServiceString : 1; 120 | unsigned int overrideServiceImages : 2; 121 | unsigned int overrideOperatorDirectory : 1; 122 | unsigned int overrideServiceContentType : 1; 123 | unsigned int overrideSecondaryServiceContentType : 1; 124 | unsigned int overrideWifiSignalStrengthRaw : 1; 125 | unsigned int overrideWifiSignalStrengthBars : 1; 126 | unsigned int overrideDataNetworkType : 1; 127 | unsigned int overrideSecondaryDataNetworkType : 1; 128 | unsigned int disallowsCellularDataNetworkTypes : 1; 129 | unsigned int overrideBatteryCapacity : 1; 130 | unsigned int overrideBatteryState : 1; 131 | unsigned int overrideBatteryDetailString : 1; 132 | unsigned int overrideBluetoothBatteryCapacity : 1; 133 | unsigned int overrideThermalColor : 1; 134 | unsigned int overrideSlowActivity : 1; 135 | unsigned int overrideActivityDisplayId : 1; 136 | unsigned int overrideBluetoothConnected : 1; 137 | unsigned int overrideBreadcrumb : 1; 138 | unsigned int overrideLock; 139 | unsigned int overrideDisplayRawGSMSignal : 1; 140 | unsigned int overrideDisplayRawWifiSignal : 1; 141 | unsigned int overridePersonName : 1; 142 | unsigned int overrideWifiLinkWarning : 1; 143 | unsigned int overrideSecondaryCellularConfigured : 1; 144 | unsigned int overridePrimaryServiceBadgeString : 1; 145 | unsigned int overrideSecondaryServiceBadgeString : 1; 146 | StatusBarRawData values; 147 | } StatusBarOverrideData; 148 | 149 | @class UIStatusBarServer; 150 | 151 | @protocol UIStatusBarServerClient 152 | 153 | @required 154 | 155 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveDoubleHeightStatusString:(NSString *)arg2 forStyle:(long long)arg3; 156 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveGlowAnimationState:(bool)arg2 forStyle:(long long)arg3; 157 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveStatusBarData:(const StatusBarRawData *)arg2 withActions:(int)arg3; 158 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveStyleOverrides:(int)arg2; 159 | 160 | @end 161 | 162 | @interface UIStatusBarServer : NSObject 163 | 164 | @property (nonatomic, strong) id statusBar; 165 | 166 | + (void)postStatusBarOverrideData:(StatusBarOverrideData *)arg1; 167 | + (void)permanentizeStatusBarOverrideData; 168 | + (StatusBarOverrideData *)getStatusBarOverrideData; 169 | 170 | @end 171 | 172 | @implementation StatusSetter14 173 | 174 | // BELOW IS UNIQUE TO iOS 14 175 | 176 | - (void) applyChanges:(StatusBarOverrideData*)overrides { 177 | if (!StatusManager.sharedInstance.isMDCMode) { 178 | [UIStatusBarServer postStatusBarOverrideData:overrides]; 179 | [UIStatusBarServer permanentizeStatusBarOverrideData]; 180 | } else { 181 | return; 182 | } 183 | } 184 | 185 | - (StatusBarOverrideData*) getOverrides { 186 | if (!StatusManager.sharedInstance.isMDCMode) { 187 | return [UIStatusBarServer getStatusBarOverrideData]; 188 | } else { 189 | return NULL; 190 | } 191 | } 192 | 193 | // ALL BELOW HERE IS IDENTICAL IN EACH SETTER 194 | 195 | - (bool) isCarrierOverridden { 196 | StatusBarOverrideData *overrides = [self getOverrides]; 197 | return overrides->overrideServiceString == 1; 198 | } 199 | 200 | - (NSString*) getCarrierOverride { 201 | StatusBarOverrideData *overrides = [self getOverrides]; 202 | NSString* carrier = @(overrides->values.serviceString); 203 | return carrier; 204 | } 205 | 206 | - (void) setCarrier:(NSString*)text { 207 | StatusBarOverrideData *overrides = [self getOverrides]; 208 | overrides->overrideServiceString = 1; 209 | overrides->overrideSecondaryServiceString = 1; 210 | strcpy(overrides->values.serviceString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 211 | strcpy(overrides->values.serviceCrossfadeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 212 | strcpy(overrides->values.secondaryServiceString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 213 | strcpy(overrides->values.secondaryServiceCrossfadeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 214 | [self applyChanges:overrides]; 215 | } 216 | 217 | - (void) unsetCarrier { 218 | StatusBarOverrideData *overrides = [self getOverrides]; 219 | overrides->overrideServiceString = 0; 220 | overrides->overrideSecondaryServiceString = 0; 221 | [self applyChanges:overrides]; 222 | } 223 | 224 | - (bool) isTimeOverridden { 225 | StatusBarOverrideData *overrides = [self getOverrides]; 226 | return overrides->overrideTimeString == 1; 227 | } 228 | 229 | - (NSString*) getTimeOverride { 230 | StatusBarOverrideData *overrides = [self getOverrides]; 231 | NSString* time = @(overrides->values.timeString); 232 | return time; 233 | } 234 | 235 | - (void) setTime:(NSString*)text { 236 | StatusBarOverrideData *overrides = [self getOverrides]; 237 | strcpy(overrides->values.timeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 238 | overrides->overrideTimeString = 1; 239 | [self applyChanges:overrides]; 240 | } 241 | 242 | - (void) unsetTime { 243 | StatusBarOverrideData *overrides = [self getOverrides]; 244 | overrides->overrideTimeString = 0; 245 | [self applyChanges:overrides]; 246 | } 247 | 248 | - (bool) isCrumbOverridden { 249 | StatusBarOverrideData *overrides = [self getOverrides]; 250 | return overrides->overrideBreadcrumb == 1; 251 | } 252 | 253 | - (NSString*) getCrumbOverride { 254 | StatusBarOverrideData *overrides = [self getOverrides]; 255 | NSString* crumb = @(overrides->values.breadcrumbTitle); 256 | if (crumb.length > 1) { 257 | return [crumb substringToIndex:[crumb length] - 2]; 258 | } else { 259 | return @""; 260 | } 261 | } 262 | 263 | - (void) setCrumb:(NSString*)text { 264 | StatusBarOverrideData *overrides = [self getOverrides]; 265 | overrides->overrideBreadcrumb = 1; 266 | strcpy(overrides->values.breadcrumbTitle, [[text stringByAppendingString:@" ▶"] cStringUsingEncoding:NSUTF8StringEncoding]); 267 | [self applyChanges:overrides]; 268 | } 269 | 270 | - (void) unsetCrumb { 271 | StatusBarOverrideData *overrides = [self getOverrides]; 272 | strcpy(overrides->values.breadcrumbTitle, [@"" cStringUsingEncoding:NSUTF8StringEncoding]); 273 | overrides->overrideBreadcrumb = 0; 274 | [self applyChanges:overrides]; 275 | } 276 | 277 | - (bool) isClockHidden { 278 | StatusBarOverrideData *overrides = [self getOverrides]; 279 | return overrides->overrideItemIsEnabled[TimeStatusBarItem] == 1; 280 | } 281 | 282 | - (void) hideClock:(bool)hidden { 283 | StatusBarOverrideData *overrides = [self getOverrides]; 284 | if (hidden) { 285 | overrides->overrideItemIsEnabled[TimeStatusBarItem] = 1; 286 | overrides->values.itemIsEnabled[TimeStatusBarItem] = 0; 287 | } else { 288 | overrides->overrideItemIsEnabled[TimeStatusBarItem] = 0; 289 | } 290 | 291 | [self applyChanges:overrides]; 292 | } 293 | 294 | - (bool) isDNDHidden { 295 | StatusBarOverrideData *overrides = [self getOverrides]; 296 | return overrides->overrideItemIsEnabled[QuietModeStatusBarItem] == 1; 297 | } 298 | 299 | - (void) hideDND:(bool)hidden { 300 | StatusBarOverrideData *overrides = [self getOverrides]; 301 | if (hidden) { 302 | overrides->overrideItemIsEnabled[QuietModeStatusBarItem] = 1; 303 | overrides->values.itemIsEnabled[QuietModeStatusBarItem] = 0; 304 | } else { 305 | overrides->overrideItemIsEnabled[QuietModeStatusBarItem] = 0; 306 | } 307 | 308 | [self applyChanges:overrides]; 309 | } 310 | 311 | - (bool) isAirplaneHidden { 312 | StatusBarOverrideData *overrides = [self getOverrides]; 313 | return overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] == 1; 314 | } 315 | 316 | - (void) hideAirplane:(bool)hidden { 317 | StatusBarOverrideData *overrides = [self getOverrides]; 318 | if (hidden) { 319 | overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] = 1; 320 | overrides->values.itemIsEnabled[AirplaneModeStatusBarItem] = 0; 321 | } else { 322 | overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] = 0; 323 | } 324 | 325 | [self applyChanges:overrides]; 326 | } 327 | 328 | - (bool) isCellHidden { 329 | StatusBarOverrideData *overrides = [self getOverrides]; 330 | return overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] == 1; 331 | } 332 | 333 | - (void) hideCell:(bool)hidden { 334 | StatusBarOverrideData *overrides = [self getOverrides]; 335 | if (hidden) { 336 | overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] = 1; 337 | overrides->values.itemIsEnabled[CellularServiceStatusBarItem] = 0; 338 | overrides->overrideItemIsEnabled[SecondaryCellularServiceStatusBarItem] = 1; 339 | overrides->values.itemIsEnabled[SecondaryCellularServiceStatusBarItem] = 0; 340 | } else { 341 | overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] = 0; 342 | overrides->overrideItemIsEnabled[SecondaryCellularServiceStatusBarItem] = 0; 343 | } 344 | 345 | [self applyChanges:overrides]; 346 | } 347 | 348 | - (bool) isWiFiHidden { 349 | StatusBarOverrideData *overrides = [self getOverrides]; 350 | return overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] == 1; 351 | } 352 | 353 | - (void) hideWiFi:(bool)hidden { 354 | StatusBarOverrideData *overrides = [self getOverrides]; 355 | if (hidden) { 356 | overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] = 1; 357 | overrides->values.itemIsEnabled[CellularDataNetworkStatusBarItem] = 0; 358 | overrides->overrideItemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 1; 359 | overrides->values.itemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 0; 360 | } else { 361 | overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] = 0; 362 | overrides->overrideItemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 0; 363 | } 364 | 365 | [self applyChanges:overrides]; 366 | } 367 | 368 | - (bool) isBatteryHidden { 369 | StatusBarOverrideData *overrides = [self getOverrides]; 370 | return overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] == 1; 371 | } 372 | 373 | - (void) hideBattery:(bool)hidden { 374 | StatusBarOverrideData *overrides = [self getOverrides]; 375 | if (hidden) { 376 | overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] = 1; 377 | overrides->values.itemIsEnabled[MainBatteryStatusBarItem] = 0; 378 | } else { 379 | overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] = 0; 380 | } 381 | 382 | [self applyChanges:overrides]; 383 | } 384 | 385 | - (bool) isBluetoothHidden { 386 | StatusBarOverrideData *overrides = [self getOverrides]; 387 | return overrides->overrideItemIsEnabled[BluetoothStatusBarItem] == 1; 388 | } 389 | 390 | - (void) hideBluetooth:(bool)hidden { 391 | StatusBarOverrideData *overrides = [self getOverrides]; 392 | if (hidden) { 393 | overrides->overrideItemIsEnabled[BluetoothStatusBarItem] = 1; 394 | overrides->values.itemIsEnabled[BluetoothStatusBarItem] = 0; 395 | } else { 396 | overrides->overrideItemIsEnabled[BluetoothStatusBarItem] = 0; 397 | } 398 | 399 | [self applyChanges:overrides]; 400 | } 401 | 402 | - (bool) isAlarmHidden { 403 | StatusBarOverrideData *overrides = [self getOverrides]; 404 | return overrides->overrideItemIsEnabled[AlarmStatusBarItem] == 1; 405 | } 406 | 407 | - (void) hideAlarm:(bool)hidden { 408 | StatusBarOverrideData *overrides = [self getOverrides]; 409 | if (hidden) { 410 | overrides->overrideItemIsEnabled[AlarmStatusBarItem] = 1; 411 | overrides->values.itemIsEnabled[AlarmStatusBarItem] = 0; 412 | } else { 413 | overrides->overrideItemIsEnabled[AlarmStatusBarItem] = 0; 414 | } 415 | 416 | [self applyChanges:overrides]; 417 | } 418 | 419 | - (bool) isLocationHidden { 420 | StatusBarOverrideData *overrides = [self getOverrides]; 421 | return overrides->overrideItemIsEnabled[LocationStatusBarItem] == 1; 422 | } 423 | 424 | - (void) hideLocation:(bool)hidden { 425 | StatusBarOverrideData *overrides = [self getOverrides]; 426 | if (hidden) { 427 | overrides->overrideItemIsEnabled[LocationStatusBarItem] = 1; 428 | overrides->values.itemIsEnabled[LocationStatusBarItem] = 0; 429 | } else { 430 | overrides->overrideItemIsEnabled[LocationStatusBarItem] = 0; 431 | } 432 | 433 | [self applyChanges:overrides]; 434 | } 435 | 436 | - (bool) isRotationHidden { 437 | StatusBarOverrideData *overrides = [self getOverrides]; 438 | return overrides->overrideItemIsEnabled[RotationLockStatusBarItem] == 1; 439 | } 440 | 441 | - (void) hideRotation:(bool)hidden { 442 | StatusBarOverrideData *overrides = [self getOverrides]; 443 | if (hidden) { 444 | overrides->overrideItemIsEnabled[RotationLockStatusBarItem] = 1; 445 | overrides->values.itemIsEnabled[RotationLockStatusBarItem] = 0; 446 | } else { 447 | overrides->overrideItemIsEnabled[RotationLockStatusBarItem] = 0; 448 | } 449 | 450 | [self applyChanges:overrides]; 451 | } 452 | 453 | - (bool) isAirPlayHidden { 454 | StatusBarOverrideData *overrides = [self getOverrides]; 455 | return overrides->overrideItemIsEnabled[AirPlayStatusBarItem] == 1; 456 | } 457 | 458 | - (void) hideAirPlay:(bool)hidden { 459 | StatusBarOverrideData *overrides = [self getOverrides]; 460 | if (hidden) { 461 | overrides->overrideItemIsEnabled[AirPlayStatusBarItem] = 1; 462 | overrides->values.itemIsEnabled[AirPlayStatusBarItem] = 0; 463 | } else { 464 | overrides->overrideItemIsEnabled[AirPlayStatusBarItem] = 0; 465 | } 466 | 467 | [self applyChanges:overrides]; 468 | } 469 | 470 | - (bool) isCarPlayHidden { 471 | StatusBarOverrideData *overrides = [self getOverrides]; 472 | return overrides->overrideItemIsEnabled[CarPlayStatusBarItem] == 1; 473 | } 474 | 475 | - (void) hideCarPlay:(bool)hidden { 476 | StatusBarOverrideData *overrides = [self getOverrides]; 477 | if (hidden) { 478 | overrides->overrideItemIsEnabled[CarPlayStatusBarItem] = 1; 479 | overrides->values.itemIsEnabled[CarPlayStatusBarItem] = 0; 480 | } else { 481 | overrides->overrideItemIsEnabled[CarPlayStatusBarItem] = 0; 482 | } 483 | 484 | [self applyChanges:overrides]; 485 | } 486 | 487 | - (bool) isVPNHidden { 488 | StatusBarOverrideData *overrides = [self getOverrides]; 489 | return overrides->overrideItemIsEnabled[VPNStatusBarItem] == 1; 490 | } 491 | 492 | - (void) hideVPN:(bool)hidden { 493 | StatusBarOverrideData *overrides = [self getOverrides]; 494 | if (hidden) { 495 | overrides->overrideItemIsEnabled[VPNStatusBarItem] = 1; 496 | overrides->values.itemIsEnabled[VPNStatusBarItem] = 0; 497 | } else { 498 | overrides->overrideItemIsEnabled[VPNStatusBarItem] = 0; 499 | } 500 | 501 | [self applyChanges:overrides]; 502 | } 503 | 504 | - (bool) isMicrophoneUseHidden { 505 | StatusBarOverrideData *overrides = [self getOverrides]; 506 | return overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] == 1; 507 | } 508 | 509 | - (void) hideMicrophoneUse:(bool)hidden { 510 | StatusBarOverrideData *overrides = [self getOverrides]; 511 | if (hidden) { 512 | overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] = 1; 513 | overrides->values.itemIsEnabled[MicrophoneUseStatusBarItem] = 0; 514 | } else { 515 | overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] = 0; 516 | } 517 | 518 | [self applyChanges:overrides]; 519 | } 520 | 521 | - (bool) isCameraUseHidden { 522 | StatusBarOverrideData *overrides = [self getOverrides]; 523 | return overrides->overrideItemIsEnabled[CameraUseStatusBarItem] == 1; 524 | } 525 | 526 | - (void) hideCameraUse:(bool)hidden { 527 | StatusBarOverrideData *overrides = [self getOverrides]; 528 | if (hidden) { 529 | overrides->overrideItemIsEnabled[CameraUseStatusBarItem] = 1; 530 | overrides->values.itemIsEnabled[CameraUseStatusBarItem] = 0; 531 | } else { 532 | overrides->overrideItemIsEnabled[CameraUseStatusBarItem] = 0; 533 | } 534 | 535 | [self applyChanges:overrides]; 536 | } 537 | 538 | @end 539 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/iOS15/StatusSetter15.m: -------------------------------------------------------------------------------- 1 | #import "StatusSetter15.h" 2 | #import "StatusManager.h" 3 | 4 | typedef NS_ENUM(int, StatusBarItem) { 5 | TimeStatusBarItem = 0, 6 | DateStatusBarItem = 1, 7 | QuietModeStatusBarItem = 2, 8 | AirplaneModeStatusBarItem = 3, 9 | CellularSignalStrengthStatusBarItem = 4, 10 | SecondaryCellularSignalStrengthStatusBarItem = 5, 11 | CellularServiceStatusBarItem = 6, 12 | SecondaryCellularServiceStatusBarItem = 7, 13 | // 8 14 | CellularDataNetworkStatusBarItem = 9, 15 | SecondaryCellularDataNetworkStatusBarItem = 10, 16 | // 11 17 | MainBatteryStatusBarItem = 12, 18 | ProminentlyShowBatteryDetailStatusBarItem = 13, 19 | // 14 20 | // 15 21 | BluetoothStatusBarItem = 16, 22 | TTYStatusBarItem = 17, 23 | AlarmStatusBarItem = 18, 24 | // 19 25 | // 20 26 | LocationStatusBarItem = 21, 27 | RotationLockStatusBarItem = 22, 28 | CameraUseStatusBarItem = 23, 29 | AirPlayStatusBarItem = 24, 30 | AssistantStatusBarItem = 25, 31 | CarPlayStatusBarItem = 26, 32 | StudentStatusBarItem = 27, 33 | MicrophoneUseStatusBarItem = 28, 34 | VPNStatusBarItem = 29, 35 | // 30 36 | // 31 37 | // 32 38 | // 33 39 | // 34 40 | // 35 41 | // 36 42 | // 37 43 | LiquidDetectionStatusBarItem = 38, 44 | VoiceControlStatusBarItem = 39, 45 | // 40 46 | // 41 47 | }; 48 | 49 | typedef NS_ENUM(unsigned int, BatteryState) { 50 | BatteryStateUnplugged = 0 51 | }; 52 | 53 | typedef struct { 54 | bool itemIsEnabled[44]; 55 | char timeString[64]; 56 | char shortTimeString[64]; 57 | char dateString[256]; 58 | int gsmSignalStrengthRaw; 59 | int secondaryGsmSignalStrengthRaw; 60 | int gsmSignalStrengthBars; 61 | int secondaryGsmSignalStrengthBars; 62 | char serviceString[100]; 63 | char secondaryServiceString[100]; 64 | char serviceCrossfadeString[100]; 65 | char secondaryServiceCrossfadeString[100]; 66 | char serviceImages[2][100]; 67 | char operatorDirectory[1024]; 68 | unsigned int serviceContentType; 69 | unsigned int secondaryServiceContentType; 70 | unsigned int cellLowDataModeActive:1; 71 | unsigned int secondaryCellLowDataModeActive:1; 72 | int wifiSignalStrengthRaw; 73 | int wifiSignalStrengthBars; 74 | unsigned int wifiLowDataModeActive:1; 75 | unsigned int dataNetworkType; 76 | unsigned int secondaryDataNetworkType; 77 | int batteryCapacity; 78 | unsigned int batteryState; 79 | char batteryDetailString[150]; 80 | int bluetoothBatteryCapacity; 81 | int thermalColor; 82 | unsigned int thermalSunlightMode : 1; 83 | unsigned int slowActivity : 1; 84 | unsigned int syncActivity : 1; 85 | char activityDisplayId[256]; 86 | unsigned int bluetoothConnected : 1; 87 | unsigned int displayRawGSMSignal : 1; 88 | unsigned int displayRawWifiSignal : 1; 89 | unsigned int locationIconType : 1; 90 | unsigned int voiceControlIconType:2; 91 | unsigned int quietModeInactive : 1; 92 | unsigned int tetheringConnectionCount; 93 | unsigned int batterySaverModeActive : 1; 94 | unsigned int deviceIsRTL : 1; 95 | unsigned int lock : 1; 96 | char breadcrumbTitle[256]; 97 | char breadcrumbSecondaryTitle[256]; 98 | char personName[100]; 99 | unsigned int electronicTollCollectionAvailable : 1; 100 | unsigned int radarAvailable : 1; 101 | unsigned int wifiLinkWarning : 1; 102 | unsigned int wifiSearching : 1; 103 | double backgroundActivityDisplayStartDate; 104 | unsigned int shouldShowEmergencyOnlyStatus : 1; 105 | unsigned int secondaryCellularConfigured : 1; 106 | char primaryServiceBadgeString[100]; 107 | char secondaryServiceBadgeString[100]; 108 | char quietModeImage[256]; 109 | } StatusBarRawData; 110 | 111 | typedef struct { 112 | bool overrideItemIsEnabled[44]; 113 | unsigned int overrideTimeString : 1; 114 | unsigned int overrideDateString : 1; 115 | unsigned int overrideGsmSignalStrengthRaw : 1; 116 | unsigned int overrideSecondaryGsmSignalStrengthRaw : 1; 117 | unsigned int overrideGsmSignalStrengthBars : 1; 118 | unsigned int overrideSecondaryGsmSignalStrengthBars : 1; 119 | unsigned int overrideServiceString : 1; 120 | unsigned int overrideSecondaryServiceString : 1; 121 | unsigned int overrideServiceImages : 2; 122 | unsigned int overrideOperatorDirectory : 1; 123 | unsigned int overrideServiceContentType : 1; 124 | unsigned int overrideSecondaryServiceContentType : 1; 125 | unsigned int overrideWifiSignalStrengthRaw : 1; 126 | unsigned int overrideWifiSignalStrengthBars : 1; 127 | unsigned int overrideDataNetworkType : 1; 128 | unsigned int overrideSecondaryDataNetworkType : 1; 129 | unsigned int disallowsCellularDataNetworkTypes : 1; 130 | unsigned int overrideBatteryCapacity : 1; 131 | unsigned int overrideBatteryState : 1; 132 | unsigned int overrideBatteryDetailString : 1; 133 | unsigned int overrideBluetoothBatteryCapacity : 1; 134 | unsigned int overrideThermalColor : 1; 135 | unsigned int overrideSlowActivity : 1; 136 | unsigned int overrideActivityDisplayId : 1; 137 | unsigned int overrideBluetoothConnected : 1; 138 | unsigned int overrideBreadcrumb : 1; 139 | unsigned int overrideLock; 140 | unsigned int overrideDisplayRawGSMSignal : 1; 141 | unsigned int overrideDisplayRawWifiSignal : 1; 142 | unsigned int overridePersonName : 1; 143 | unsigned int overrideWifiLinkWarning : 1; 144 | unsigned int overrideSecondaryCellularConfigured : 1; 145 | unsigned int overridePrimaryServiceBadgeString : 1; 146 | unsigned int overrideSecondaryServiceBadgeString : 1; 147 | unsigned int overrideQuietModeImage : 1; 148 | StatusBarRawData values; 149 | } StatusBarOverrideData; 150 | 151 | @class UIStatusBarServer; 152 | 153 | @protocol UIStatusBarServerClient 154 | 155 | @required 156 | 157 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveDoubleHeightStatusString:(NSString *)arg2 forStyle:(long long)arg3; 158 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveGlowAnimationState:(bool)arg2 forStyle:(long long)arg3; 159 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveStatusBarData:(const StatusBarRawData *)arg2 withActions:(int)arg3; 160 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveStyleOverrides:(int)arg2; 161 | 162 | @end 163 | 164 | @interface UIStatusBarServer : NSObject 165 | 166 | @property (nonatomic, strong) id statusBar; 167 | 168 | + (void)postStatusBarOverrideData:(StatusBarOverrideData *)arg1; 169 | + (void)permanentizeStatusBarOverrideData; 170 | + (StatusBarOverrideData *)getStatusBarOverrideData; 171 | 172 | @end 173 | 174 | @implementation StatusSetter15 175 | 176 | // BELOW IS THE SAME IN iOS 15, 16, 16.1, and 16.3 177 | 178 | - (void) applyChanges:(StatusBarOverrideData*)overrides { 179 | if (!StatusManager.sharedInstance.isMDCMode) { 180 | [UIStatusBarServer postStatusBarOverrideData:overrides]; 181 | [UIStatusBarServer permanentizeStatusBarOverrideData]; 182 | } else { 183 | FILE *outfile; 184 | outfile = fopen ("/var/mobile/Library/SpringBoard/statusBarOverridesEditing", "w+"); 185 | if (outfile == NULL) return; 186 | 187 | char padding[256] = {'\0'}; 188 | 189 | fwrite (overrides, sizeof(StatusBarOverrideData), 1, outfile); 190 | fwrite (padding, sizeof(padding), 1, outfile); 191 | 192 | fclose (outfile); 193 | } 194 | } 195 | 196 | - (StatusBarOverrideData*) getOverrides { 197 | if (!StatusManager.sharedInstance.isMDCMode) { 198 | return [UIStatusBarServer getStatusBarOverrideData]; 199 | } else { 200 | NSFileManager *fileManager = [NSFileManager defaultManager]; 201 | NSString *path = @"/var/mobile/Library/SpringBoard/statusBarOverridesEditing"; 202 | if ([fileManager fileExistsAtPath:path]){ 203 | FILE *infile; 204 | NSMutableData* data = [NSMutableData dataWithLength:sizeof(StatusBarOverrideData)]; 205 | StatusBarOverrideData* input = [data mutableBytes]; 206 | infile = fopen ("/var/mobile/Library/SpringBoard/statusBarOverridesEditing", "r"); 207 | if (infile == NULL) return NULL; 208 | if (fread(input, sizeof(StatusBarOverrideData), 1, infile) != 0) { 209 | fclose (infile); 210 | return input; 211 | } 212 | fclose (infile); 213 | return NULL; 214 | } else { 215 | StatusBarOverrideData* overrides = [UIStatusBarServer getStatusBarOverrideData]; 216 | [self applyChanges:overrides]; 217 | return overrides; 218 | } 219 | } 220 | } 221 | 222 | // ALL BELOW HERE IS IDENTICAL IN EACH SETTER 223 | 224 | - (bool) isCarrierOverridden { 225 | StatusBarOverrideData *overrides = [self getOverrides]; 226 | return overrides->overrideServiceString == 1; 227 | } 228 | 229 | - (NSString*) getCarrierOverride { 230 | StatusBarOverrideData *overrides = [self getOverrides]; 231 | NSString* carrier = @(overrides->values.serviceString); 232 | return carrier; 233 | } 234 | 235 | - (void) setCarrier:(NSString*)text { 236 | StatusBarOverrideData *overrides = [self getOverrides]; 237 | overrides->overrideServiceString = 1; 238 | overrides->overrideSecondaryServiceString = 1; 239 | strcpy(overrides->values.serviceString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 240 | strcpy(overrides->values.serviceCrossfadeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 241 | strcpy(overrides->values.secondaryServiceString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 242 | strcpy(overrides->values.secondaryServiceCrossfadeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 243 | [self applyChanges:overrides]; 244 | } 245 | 246 | - (void) unsetCarrier { 247 | StatusBarOverrideData *overrides = [self getOverrides]; 248 | overrides->overrideServiceString = 0; 249 | overrides->overrideSecondaryServiceString = 0; 250 | [self applyChanges:overrides]; 251 | } 252 | 253 | - (bool) isTimeOverridden { 254 | StatusBarOverrideData *overrides = [self getOverrides]; 255 | return overrides->overrideTimeString == 1; 256 | } 257 | 258 | - (NSString*) getTimeOverride { 259 | StatusBarOverrideData *overrides = [self getOverrides]; 260 | NSString* time = @(overrides->values.timeString); 261 | return time; 262 | } 263 | 264 | - (void) setTime:(NSString*)text { 265 | StatusBarOverrideData *overrides = [self getOverrides]; 266 | strcpy(overrides->values.timeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 267 | overrides->overrideTimeString = 1; 268 | [self applyChanges:overrides]; 269 | } 270 | 271 | - (void) unsetTime { 272 | StatusBarOverrideData *overrides = [self getOverrides]; 273 | overrides->overrideTimeString = 0; 274 | [self applyChanges:overrides]; 275 | } 276 | 277 | - (bool) isCrumbOverridden { 278 | StatusBarOverrideData *overrides = [self getOverrides]; 279 | return overrides->overrideBreadcrumb == 1; 280 | } 281 | 282 | - (NSString*) getCrumbOverride { 283 | StatusBarOverrideData *overrides = [self getOverrides]; 284 | NSString* crumb = @(overrides->values.breadcrumbTitle); 285 | if (crumb.length > 1) { 286 | return [crumb substringToIndex:[crumb length] - 2]; 287 | } else { 288 | return @""; 289 | } 290 | } 291 | 292 | - (void) setCrumb:(NSString*)text { 293 | StatusBarOverrideData *overrides = [self getOverrides]; 294 | overrides->overrideBreadcrumb = 1; 295 | strcpy(overrides->values.breadcrumbTitle, [[text stringByAppendingString:@" ▶"] cStringUsingEncoding:NSUTF8StringEncoding]); 296 | [self applyChanges:overrides]; 297 | } 298 | 299 | - (void) unsetCrumb { 300 | StatusBarOverrideData *overrides = [self getOverrides]; 301 | strcpy(overrides->values.breadcrumbTitle, [@"" cStringUsingEncoding:NSUTF8StringEncoding]); 302 | overrides->overrideBreadcrumb = 0; 303 | [self applyChanges:overrides]; 304 | } 305 | 306 | - (bool) isClockHidden { 307 | StatusBarOverrideData *overrides = [self getOverrides]; 308 | return overrides->overrideItemIsEnabled[TimeStatusBarItem] == 1; 309 | } 310 | 311 | - (void) hideClock:(bool)hidden { 312 | StatusBarOverrideData *overrides = [self getOverrides]; 313 | if (hidden) { 314 | overrides->overrideItemIsEnabled[TimeStatusBarItem] = 1; 315 | overrides->values.itemIsEnabled[TimeStatusBarItem] = 0; 316 | } else { 317 | overrides->overrideItemIsEnabled[TimeStatusBarItem] = 0; 318 | } 319 | 320 | [self applyChanges:overrides]; 321 | } 322 | 323 | - (bool) isDNDHidden { 324 | StatusBarOverrideData *overrides = [self getOverrides]; 325 | return overrides->overrideItemIsEnabled[QuietModeStatusBarItem] == 1; 326 | } 327 | 328 | - (void) hideDND:(bool)hidden { 329 | StatusBarOverrideData *overrides = [self getOverrides]; 330 | if (hidden) { 331 | overrides->overrideItemIsEnabled[QuietModeStatusBarItem] = 1; 332 | overrides->values.itemIsEnabled[QuietModeStatusBarItem] = 0; 333 | } else { 334 | overrides->overrideItemIsEnabled[QuietModeStatusBarItem] = 0; 335 | } 336 | 337 | [self applyChanges:overrides]; 338 | } 339 | 340 | - (bool) isAirplaneHidden { 341 | StatusBarOverrideData *overrides = [self getOverrides]; 342 | return overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] == 1; 343 | } 344 | 345 | - (void) hideAirplane:(bool)hidden { 346 | StatusBarOverrideData *overrides = [self getOverrides]; 347 | if (hidden) { 348 | overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] = 1; 349 | overrides->values.itemIsEnabled[AirplaneModeStatusBarItem] = 0; 350 | } else { 351 | overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] = 0; 352 | } 353 | 354 | [self applyChanges:overrides]; 355 | } 356 | 357 | - (bool) isCellHidden { 358 | StatusBarOverrideData *overrides = [self getOverrides]; 359 | return overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] == 1; 360 | } 361 | 362 | - (void) hideCell:(bool)hidden { 363 | StatusBarOverrideData *overrides = [self getOverrides]; 364 | if (hidden) { 365 | overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] = 1; 366 | overrides->values.itemIsEnabled[CellularServiceStatusBarItem] = 0; 367 | overrides->overrideItemIsEnabled[SecondaryCellularServiceStatusBarItem] = 1; 368 | overrides->values.itemIsEnabled[SecondaryCellularServiceStatusBarItem] = 0; 369 | } else { 370 | overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] = 0; 371 | overrides->overrideItemIsEnabled[SecondaryCellularServiceStatusBarItem] = 0; 372 | } 373 | 374 | [self applyChanges:overrides]; 375 | } 376 | 377 | - (bool) isWiFiHidden { 378 | StatusBarOverrideData *overrides = [self getOverrides]; 379 | return overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] == 1; 380 | } 381 | 382 | - (void) hideWiFi:(bool)hidden { 383 | StatusBarOverrideData *overrides = [self getOverrides]; 384 | if (hidden) { 385 | overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] = 1; 386 | overrides->values.itemIsEnabled[CellularDataNetworkStatusBarItem] = 0; 387 | overrides->overrideItemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 1; 388 | overrides->values.itemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 0; 389 | } else { 390 | overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] = 0; 391 | overrides->overrideItemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 0; 392 | } 393 | 394 | [self applyChanges:overrides]; 395 | } 396 | 397 | - (bool) isBatteryHidden { 398 | StatusBarOverrideData *overrides = [self getOverrides]; 399 | return overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] == 1; 400 | } 401 | 402 | - (void) hideBattery:(bool)hidden { 403 | StatusBarOverrideData *overrides = [self getOverrides]; 404 | if (hidden) { 405 | overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] = 1; 406 | overrides->values.itemIsEnabled[MainBatteryStatusBarItem] = 0; 407 | } else { 408 | overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] = 0; 409 | } 410 | 411 | [self applyChanges:overrides]; 412 | } 413 | 414 | - (bool) isBluetoothHidden { 415 | StatusBarOverrideData *overrides = [self getOverrides]; 416 | return overrides->overrideItemIsEnabled[BluetoothStatusBarItem] == 1; 417 | } 418 | 419 | - (void) hideBluetooth:(bool)hidden { 420 | StatusBarOverrideData *overrides = [self getOverrides]; 421 | if (hidden) { 422 | overrides->overrideItemIsEnabled[BluetoothStatusBarItem] = 1; 423 | overrides->values.itemIsEnabled[BluetoothStatusBarItem] = 0; 424 | } else { 425 | overrides->overrideItemIsEnabled[BluetoothStatusBarItem] = 0; 426 | } 427 | 428 | [self applyChanges:overrides]; 429 | } 430 | 431 | - (bool) isAlarmHidden { 432 | StatusBarOverrideData *overrides = [self getOverrides]; 433 | return overrides->overrideItemIsEnabled[AlarmStatusBarItem] == 1; 434 | } 435 | 436 | - (void) hideAlarm:(bool)hidden { 437 | StatusBarOverrideData *overrides = [self getOverrides]; 438 | if (hidden) { 439 | overrides->overrideItemIsEnabled[AlarmStatusBarItem] = 1; 440 | overrides->values.itemIsEnabled[AlarmStatusBarItem] = 0; 441 | } else { 442 | overrides->overrideItemIsEnabled[AlarmStatusBarItem] = 0; 443 | } 444 | 445 | [self applyChanges:overrides]; 446 | } 447 | 448 | - (bool) isLocationHidden { 449 | StatusBarOverrideData *overrides = [self getOverrides]; 450 | return overrides->overrideItemIsEnabled[LocationStatusBarItem] == 1; 451 | } 452 | 453 | - (void) hideLocation:(bool)hidden { 454 | StatusBarOverrideData *overrides = [self getOverrides]; 455 | if (hidden) { 456 | overrides->overrideItemIsEnabled[LocationStatusBarItem] = 1; 457 | overrides->values.itemIsEnabled[LocationStatusBarItem] = 0; 458 | } else { 459 | overrides->overrideItemIsEnabled[LocationStatusBarItem] = 0; 460 | } 461 | 462 | [self applyChanges:overrides]; 463 | } 464 | 465 | - (bool) isRotationHidden { 466 | StatusBarOverrideData *overrides = [self getOverrides]; 467 | return overrides->overrideItemIsEnabled[RotationLockStatusBarItem] == 1; 468 | } 469 | 470 | - (void) hideRotation:(bool)hidden { 471 | StatusBarOverrideData *overrides = [self getOverrides]; 472 | if (hidden) { 473 | overrides->overrideItemIsEnabled[RotationLockStatusBarItem] = 1; 474 | overrides->values.itemIsEnabled[RotationLockStatusBarItem] = 0; 475 | } else { 476 | overrides->overrideItemIsEnabled[RotationLockStatusBarItem] = 0; 477 | } 478 | 479 | [self applyChanges:overrides]; 480 | } 481 | 482 | - (bool) isAirPlayHidden { 483 | StatusBarOverrideData *overrides = [self getOverrides]; 484 | return overrides->overrideItemIsEnabled[AirPlayStatusBarItem] == 1; 485 | } 486 | 487 | - (void) hideAirPlay:(bool)hidden { 488 | StatusBarOverrideData *overrides = [self getOverrides]; 489 | if (hidden) { 490 | overrides->overrideItemIsEnabled[AirPlayStatusBarItem] = 1; 491 | overrides->values.itemIsEnabled[AirPlayStatusBarItem] = 0; 492 | } else { 493 | overrides->overrideItemIsEnabled[AirPlayStatusBarItem] = 0; 494 | } 495 | 496 | [self applyChanges:overrides]; 497 | } 498 | 499 | - (bool) isCarPlayHidden { 500 | StatusBarOverrideData *overrides = [self getOverrides]; 501 | return overrides->overrideItemIsEnabled[CarPlayStatusBarItem] == 1; 502 | } 503 | 504 | - (void) hideCarPlay:(bool)hidden { 505 | StatusBarOverrideData *overrides = [self getOverrides]; 506 | if (hidden) { 507 | overrides->overrideItemIsEnabled[CarPlayStatusBarItem] = 1; 508 | overrides->values.itemIsEnabled[CarPlayStatusBarItem] = 0; 509 | } else { 510 | overrides->overrideItemIsEnabled[CarPlayStatusBarItem] = 0; 511 | } 512 | 513 | [self applyChanges:overrides]; 514 | } 515 | 516 | - (bool) isVPNHidden { 517 | StatusBarOverrideData *overrides = [self getOverrides]; 518 | return overrides->overrideItemIsEnabled[VPNStatusBarItem] == 1; 519 | } 520 | 521 | - (void) hideVPN:(bool)hidden { 522 | StatusBarOverrideData *overrides = [self getOverrides]; 523 | if (hidden) { 524 | overrides->overrideItemIsEnabled[VPNStatusBarItem] = 1; 525 | overrides->values.itemIsEnabled[VPNStatusBarItem] = 0; 526 | } else { 527 | overrides->overrideItemIsEnabled[VPNStatusBarItem] = 0; 528 | } 529 | 530 | [self applyChanges:overrides]; 531 | } 532 | 533 | - (bool) isMicrophoneUseHidden { 534 | StatusBarOverrideData *overrides = [self getOverrides]; 535 | return overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] == 1; 536 | } 537 | 538 | - (void) hideMicrophoneUse:(bool)hidden { 539 | StatusBarOverrideData *overrides = [self getOverrides]; 540 | if (hidden) { 541 | overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] = 1; 542 | overrides->values.itemIsEnabled[MicrophoneUseStatusBarItem] = 0; 543 | } else { 544 | overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] = 0; 545 | } 546 | 547 | [self applyChanges:overrides]; 548 | } 549 | 550 | - (bool) isCameraUseHidden { 551 | StatusBarOverrideData *overrides = [self getOverrides]; 552 | return overrides->overrideItemIsEnabled[CameraUseStatusBarItem] == 1; 553 | } 554 | 555 | - (void) hideCameraUse:(bool)hidden { 556 | StatusBarOverrideData *overrides = [self getOverrides]; 557 | if (hidden) { 558 | overrides->overrideItemIsEnabled[CameraUseStatusBarItem] = 1; 559 | overrides->values.itemIsEnabled[CameraUseStatusBarItem] = 0; 560 | } else { 561 | overrides->overrideItemIsEnabled[CameraUseStatusBarItem] = 0; 562 | } 563 | 564 | [self applyChanges:overrides]; 565 | } 566 | 567 | @end 568 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/iOS16_1/StatusSetter16_1.m: -------------------------------------------------------------------------------- 1 | #import "StatusSetter16_1.h" 2 | #import "StatusManager.h" 3 | 4 | typedef NS_ENUM(int, StatusBarItem) { 5 | TimeStatusBarItem = 0, 6 | DateStatusBarItem = 1, 7 | QuietModeStatusBarItem = 2, 8 | AirplaneModeStatusBarItem = 3, 9 | CellularSignalStrengthStatusBarItem = 4, 10 | SecondaryCellularSignalStrengthStatusBarItem = 5, 11 | CellularServiceStatusBarItem = 6, 12 | SecondaryCellularServiceStatusBarItem = 7, 13 | // 8 14 | CellularDataNetworkStatusBarItem = 9, 15 | SecondaryCellularDataNetworkStatusBarItem = 10, 16 | // 11 17 | MainBatteryStatusBarItem = 12, 18 | ProminentlyShowBatteryDetailStatusBarItem = 13, 19 | // 14 20 | // 15 21 | BluetoothStatusBarItem = 16, 22 | TTYStatusBarItem = 17, 23 | AlarmStatusBarItem = 18, 24 | // 19 25 | // 20 26 | LocationStatusBarItem = 21, 27 | RotationLockStatusBarItem = 22, 28 | CameraUseStatusBarItem = 23, 29 | AirPlayStatusBarItem = 24, 30 | AssistantStatusBarItem = 25, 31 | CarPlayStatusBarItem = 26, 32 | StudentStatusBarItem = 27, 33 | MicrophoneUseStatusBarItem = 28, 34 | VPNStatusBarItem = 29, 35 | // 30 36 | // 31 37 | // 32 38 | // 33 39 | // 34 40 | // 35 41 | // 36 42 | // 37 43 | LiquidDetectionStatusBarItem = 38, 44 | VoiceControlStatusBarItem = 39, 45 | // 40 46 | // 41 47 | // 42 48 | // 43 49 | Extra1StatusBarItem = 44, 50 | }; 51 | 52 | typedef NS_ENUM(unsigned int, BatteryState) { 53 | BatteryStateUnplugged = 0 54 | }; 55 | 56 | typedef struct { 57 | bool itemIsEnabled[45]; 58 | char padding; 59 | char timeString[64]; 60 | char shortTimeString[64]; 61 | char dateString[256]; 62 | int gsmSignalStrengthRaw; 63 | int secondaryGsmSignalStrengthRaw; 64 | int gsmSignalStrengthBars; 65 | int secondaryGsmSignalStrengthBars; 66 | char serviceString[100]; 67 | char secondaryServiceString[100]; 68 | char serviceCrossfadeString[100]; 69 | char secondaryServiceCrossfadeString[100]; 70 | char serviceImages[2][100]; 71 | char operatorDirectory[1024]; 72 | unsigned int serviceContentType; 73 | unsigned int secondaryServiceContentType; 74 | unsigned int cellLowDataModeActive:1; 75 | unsigned int secondaryCellLowDataModeActive:1; 76 | int wifiSignalStrengthRaw; 77 | int wifiSignalStrengthBars; 78 | unsigned int wifiLowDataModeActive:1; 79 | unsigned int dataNetworkType; 80 | unsigned int secondaryDataNetworkType; 81 | int batteryCapacity; 82 | unsigned int batteryState; 83 | char batteryDetailString[150]; 84 | int bluetoothBatteryCapacity; 85 | int thermalColor; 86 | unsigned int thermalSunlightMode : 1; 87 | unsigned int slowActivity : 1; 88 | unsigned int syncActivity : 1; 89 | char activityDisplayId[256]; 90 | unsigned int bluetoothConnected : 1; 91 | unsigned int displayRawGSMSignal : 1; 92 | unsigned int displayRawWifiSignal : 1; 93 | unsigned int locationIconType : 1; 94 | unsigned int voiceControlIconType:2; 95 | unsigned int quietModeInactive : 1; 96 | unsigned int tetheringConnectionCount; 97 | unsigned int batterySaverModeActive : 1; 98 | unsigned int deviceIsRTL : 1; 99 | unsigned int lock : 1; 100 | char breadcrumbTitle[256]; 101 | char breadcrumbSecondaryTitle[256]; 102 | char personName[100]; 103 | unsigned int electronicTollCollectionAvailable : 1; 104 | unsigned int radarAvailable : 1; 105 | unsigned int wifiLinkWarning : 1; 106 | unsigned int wifiSearching : 1; 107 | double backgroundActivityDisplayStartDate; 108 | unsigned int shouldShowEmergencyOnlyStatus : 1; 109 | unsigned int secondaryCellularConfigured : 1; 110 | char primaryServiceBadgeString[100]; 111 | char secondaryServiceBadgeString[100]; 112 | char quietModeImage[256]; 113 | unsigned int extra1 : 1; // Unsure of actual size, but it's at least 1 byte. Since this is at the end of the struct, and we aren't modifying this part of the struct, it likely shouldn't matter that it's not the correct size. 114 | } StatusBarRawData; 115 | 116 | typedef struct { 117 | bool overrideItemIsEnabled[45]; 118 | char padding; 119 | unsigned int overrideTimeString : 1; 120 | unsigned int overrideDateString : 1; 121 | unsigned int overrideGsmSignalStrengthRaw : 1; 122 | unsigned int overrideSecondaryGsmSignalStrengthRaw : 1; 123 | unsigned int overrideGsmSignalStrengthBars : 1; 124 | unsigned int overrideSecondaryGsmSignalStrengthBars : 1; 125 | unsigned int overrideServiceString : 1; 126 | unsigned int overrideSecondaryServiceString : 1; 127 | unsigned int overrideServiceImages : 2; 128 | unsigned int overrideOperatorDirectory : 1; 129 | unsigned int overrideServiceContentType : 1; 130 | unsigned int overrideSecondaryServiceContentType : 1; 131 | unsigned int overrideWifiSignalStrengthRaw : 1; 132 | unsigned int overrideWifiSignalStrengthBars : 1; 133 | unsigned int overrideDataNetworkType : 1; 134 | unsigned int overrideSecondaryDataNetworkType : 1; 135 | unsigned int disallowsCellularDataNetworkTypes : 1; 136 | unsigned int overrideBatteryCapacity : 1; 137 | unsigned int overrideBatteryState : 1; 138 | unsigned int overrideBatteryDetailString : 1; 139 | unsigned int overrideBluetoothBatteryCapacity : 1; 140 | unsigned int overrideThermalColor : 1; 141 | unsigned int overrideSlowActivity : 1; 142 | unsigned int overrideActivityDisplayId : 1; 143 | unsigned int overrideBluetoothConnected : 1; 144 | unsigned int overrideBreadcrumb : 1; 145 | unsigned int overrideLock; 146 | unsigned int overrideDisplayRawGSMSignal : 1; 147 | unsigned int overrideDisplayRawWifiSignal : 1; 148 | unsigned int overridePersonName : 1; 149 | unsigned int overrideWifiLinkWarning : 1; 150 | unsigned int overrideSecondaryCellularConfigured : 1; 151 | unsigned int overridePrimaryServiceBadgeString : 1; 152 | unsigned int overrideSecondaryServiceBadgeString : 1; 153 | unsigned int overrideQuietModeImage : 1; 154 | unsigned int overrideExtra1 : 1; // Not sure what this is, but there only seems to be one of them 155 | StatusBarRawData values; 156 | } StatusBarOverrideData; 157 | 158 | @class UIStatusBarServer; 159 | 160 | @protocol UIStatusBarServerClient 161 | 162 | @required 163 | 164 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveDoubleHeightStatusString:(NSString *)arg2 forStyle:(long long)arg3; 165 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveGlowAnimationState:(bool)arg2 forStyle:(long long)arg3; 166 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveStatusBarData:(const StatusBarRawData *)arg2 withActions:(int)arg3; 167 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveStyleOverrides:(int)arg2; 168 | 169 | @end 170 | 171 | @interface UIStatusBarServer : NSObject 172 | 173 | @property (nonatomic, strong) id statusBar; 174 | 175 | + (void)postStatusBarOverrideData:(StatusBarOverrideData *)arg1; 176 | + (void)permanentizeStatusBarOverrideData; 177 | + (StatusBarOverrideData *)getStatusBarOverrideData; 178 | 179 | @end 180 | 181 | @implementation StatusSetter16_1 182 | 183 | // BELOW IS THE SAME IN iOS 15, 16, 16.1, and 16.3 184 | 185 | - (void) applyChanges:(StatusBarOverrideData*)overrides { 186 | if (!StatusManager.sharedInstance.isMDCMode) { 187 | [UIStatusBarServer postStatusBarOverrideData:overrides]; 188 | [UIStatusBarServer permanentizeStatusBarOverrideData]; 189 | } else { 190 | FILE *outfile; 191 | outfile = fopen ("/var/mobile/Library/SpringBoard/statusBarOverridesEditing", "w+"); 192 | if (outfile == NULL) return; 193 | 194 | char padding[256] = {'\0'}; 195 | 196 | fwrite (overrides, sizeof(StatusBarOverrideData), 1, outfile); 197 | fwrite (padding, sizeof(padding), 1, outfile); 198 | 199 | fclose (outfile); 200 | } 201 | } 202 | 203 | - (StatusBarOverrideData*) getOverrides { 204 | if (!StatusManager.sharedInstance.isMDCMode) { 205 | return [UIStatusBarServer getStatusBarOverrideData]; 206 | } else { 207 | NSFileManager *fileManager = [NSFileManager defaultManager]; 208 | NSString *path = @"/var/mobile/Library/SpringBoard/statusBarOverridesEditing"; 209 | if ([fileManager fileExistsAtPath:path]){ 210 | FILE *infile; 211 | NSMutableData* data = [NSMutableData dataWithLength:sizeof(StatusBarOverrideData)]; 212 | StatusBarOverrideData* input = [data mutableBytes]; 213 | infile = fopen ("/var/mobile/Library/SpringBoard/statusBarOverridesEditing", "r"); 214 | if (infile == NULL) return NULL; 215 | if (fread(input, sizeof(StatusBarOverrideData), 1, infile) != 0) { 216 | fclose (infile); 217 | return input; 218 | } 219 | fclose (infile); 220 | return NULL; 221 | } else { 222 | StatusBarOverrideData* overrides = [UIStatusBarServer getStatusBarOverrideData]; 223 | [self applyChanges:overrides]; 224 | return overrides; 225 | } 226 | } 227 | } 228 | 229 | // ALL BELOW HERE IS IDENTICAL IN EACH SETTER 230 | 231 | - (bool) isCarrierOverridden { 232 | StatusBarOverrideData *overrides = [self getOverrides]; 233 | return overrides->overrideServiceString == 1; 234 | } 235 | 236 | - (NSString*) getCarrierOverride { 237 | StatusBarOverrideData *overrides = [self getOverrides]; 238 | NSString* carrier = @(overrides->values.serviceString); 239 | return carrier; 240 | } 241 | 242 | - (void) setCarrier:(NSString*)text { 243 | StatusBarOverrideData *overrides = [self getOverrides]; 244 | overrides->overrideServiceString = 1; 245 | overrides->overrideSecondaryServiceString = 1; 246 | strcpy(overrides->values.serviceString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 247 | strcpy(overrides->values.serviceCrossfadeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 248 | strcpy(overrides->values.secondaryServiceString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 249 | strcpy(overrides->values.secondaryServiceCrossfadeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 250 | [self applyChanges:overrides]; 251 | } 252 | 253 | - (void) unsetCarrier { 254 | StatusBarOverrideData *overrides = [self getOverrides]; 255 | overrides->overrideServiceString = 0; 256 | overrides->overrideSecondaryServiceString = 0; 257 | [self applyChanges:overrides]; 258 | } 259 | 260 | - (bool) isTimeOverridden { 261 | StatusBarOverrideData *overrides = [self getOverrides]; 262 | return overrides->overrideTimeString == 1; 263 | } 264 | 265 | - (NSString*) getTimeOverride { 266 | StatusBarOverrideData *overrides = [self getOverrides]; 267 | NSString* time = @(overrides->values.timeString); 268 | return time; 269 | } 270 | 271 | - (void) setTime:(NSString*)text { 272 | StatusBarOverrideData *overrides = [self getOverrides]; 273 | strcpy(overrides->values.timeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 274 | overrides->overrideTimeString = 1; 275 | [self applyChanges:overrides]; 276 | } 277 | 278 | - (void) unsetTime { 279 | StatusBarOverrideData *overrides = [self getOverrides]; 280 | overrides->overrideTimeString = 0; 281 | [self applyChanges:overrides]; 282 | } 283 | 284 | - (bool) isCrumbOverridden { 285 | StatusBarOverrideData *overrides = [self getOverrides]; 286 | return overrides->overrideBreadcrumb == 1; 287 | } 288 | 289 | - (NSString*) getCrumbOverride { 290 | StatusBarOverrideData *overrides = [self getOverrides]; 291 | NSString* crumb = @(overrides->values.breadcrumbTitle); 292 | if (crumb.length > 1) { 293 | return [crumb substringToIndex:[crumb length] - 2]; 294 | } else { 295 | return @""; 296 | } 297 | } 298 | 299 | - (void) setCrumb:(NSString*)text { 300 | StatusBarOverrideData *overrides = [self getOverrides]; 301 | overrides->overrideBreadcrumb = 1; 302 | strcpy(overrides->values.breadcrumbTitle, [[text stringByAppendingString:@" ▶"] cStringUsingEncoding:NSUTF8StringEncoding]); 303 | [self applyChanges:overrides]; 304 | } 305 | 306 | - (void) unsetCrumb { 307 | StatusBarOverrideData *overrides = [self getOverrides]; 308 | strcpy(overrides->values.breadcrumbTitle, [@"" cStringUsingEncoding:NSUTF8StringEncoding]); 309 | overrides->overrideBreadcrumb = 0; 310 | [self applyChanges:overrides]; 311 | } 312 | 313 | - (bool) isClockHidden { 314 | StatusBarOverrideData *overrides = [self getOverrides]; 315 | return overrides->overrideItemIsEnabled[TimeStatusBarItem] == 1; 316 | } 317 | 318 | - (void) hideClock:(bool)hidden { 319 | StatusBarOverrideData *overrides = [self getOverrides]; 320 | if (hidden) { 321 | overrides->overrideItemIsEnabled[TimeStatusBarItem] = 1; 322 | overrides->values.itemIsEnabled[TimeStatusBarItem] = 0; 323 | } else { 324 | overrides->overrideItemIsEnabled[TimeStatusBarItem] = 0; 325 | } 326 | 327 | [self applyChanges:overrides]; 328 | } 329 | 330 | - (bool) isDNDHidden { 331 | StatusBarOverrideData *overrides = [self getOverrides]; 332 | return overrides->overrideItemIsEnabled[QuietModeStatusBarItem] == 1; 333 | } 334 | 335 | - (void) hideDND:(bool)hidden { 336 | StatusBarOverrideData *overrides = [self getOverrides]; 337 | if (hidden) { 338 | overrides->overrideItemIsEnabled[QuietModeStatusBarItem] = 1; 339 | overrides->values.itemIsEnabled[QuietModeStatusBarItem] = 0; 340 | } else { 341 | overrides->overrideItemIsEnabled[QuietModeStatusBarItem] = 0; 342 | } 343 | 344 | [self applyChanges:overrides]; 345 | } 346 | 347 | - (bool) isAirplaneHidden { 348 | StatusBarOverrideData *overrides = [self getOverrides]; 349 | return overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] == 1; 350 | } 351 | 352 | - (void) hideAirplane:(bool)hidden { 353 | StatusBarOverrideData *overrides = [self getOverrides]; 354 | if (hidden) { 355 | overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] = 1; 356 | overrides->values.itemIsEnabled[AirplaneModeStatusBarItem] = 0; 357 | } else { 358 | overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] = 0; 359 | } 360 | 361 | [self applyChanges:overrides]; 362 | } 363 | 364 | - (bool) isCellHidden { 365 | StatusBarOverrideData *overrides = [self getOverrides]; 366 | return overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] == 1; 367 | } 368 | 369 | - (void) hideCell:(bool)hidden { 370 | StatusBarOverrideData *overrides = [self getOverrides]; 371 | if (hidden) { 372 | overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] = 1; 373 | overrides->values.itemIsEnabled[CellularServiceStatusBarItem] = 0; 374 | overrides->overrideItemIsEnabled[SecondaryCellularServiceStatusBarItem] = 1; 375 | overrides->values.itemIsEnabled[SecondaryCellularServiceStatusBarItem] = 0; 376 | } else { 377 | overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] = 0; 378 | overrides->overrideItemIsEnabled[SecondaryCellularServiceStatusBarItem] = 0; 379 | } 380 | 381 | [self applyChanges:overrides]; 382 | } 383 | 384 | - (bool) isWiFiHidden { 385 | StatusBarOverrideData *overrides = [self getOverrides]; 386 | return overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] == 1; 387 | } 388 | 389 | - (void) hideWiFi:(bool)hidden { 390 | StatusBarOverrideData *overrides = [self getOverrides]; 391 | if (hidden) { 392 | overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] = 1; 393 | overrides->values.itemIsEnabled[CellularDataNetworkStatusBarItem] = 0; 394 | overrides->overrideItemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 1; 395 | overrides->values.itemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 0; 396 | } else { 397 | overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] = 0; 398 | overrides->overrideItemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 0; 399 | } 400 | 401 | [self applyChanges:overrides]; 402 | } 403 | 404 | - (bool) isBatteryHidden { 405 | StatusBarOverrideData *overrides = [self getOverrides]; 406 | return overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] == 1; 407 | } 408 | 409 | - (void) hideBattery:(bool)hidden { 410 | StatusBarOverrideData *overrides = [self getOverrides]; 411 | if (hidden) { 412 | overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] = 1; 413 | overrides->values.itemIsEnabled[MainBatteryStatusBarItem] = 0; 414 | } else { 415 | overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] = 0; 416 | } 417 | 418 | [self applyChanges:overrides]; 419 | } 420 | 421 | - (bool) isBluetoothHidden { 422 | StatusBarOverrideData *overrides = [self getOverrides]; 423 | return overrides->overrideItemIsEnabled[BluetoothStatusBarItem] == 1; 424 | } 425 | 426 | - (void) hideBluetooth:(bool)hidden { 427 | StatusBarOverrideData *overrides = [self getOverrides]; 428 | if (hidden) { 429 | overrides->overrideItemIsEnabled[BluetoothStatusBarItem] = 1; 430 | overrides->values.itemIsEnabled[BluetoothStatusBarItem] = 0; 431 | } else { 432 | overrides->overrideItemIsEnabled[BluetoothStatusBarItem] = 0; 433 | } 434 | 435 | [self applyChanges:overrides]; 436 | } 437 | 438 | - (bool) isAlarmHidden { 439 | StatusBarOverrideData *overrides = [self getOverrides]; 440 | return overrides->overrideItemIsEnabled[AlarmStatusBarItem] == 1; 441 | } 442 | 443 | - (void) hideAlarm:(bool)hidden { 444 | StatusBarOverrideData *overrides = [self getOverrides]; 445 | if (hidden) { 446 | overrides->overrideItemIsEnabled[AlarmStatusBarItem] = 1; 447 | overrides->values.itemIsEnabled[AlarmStatusBarItem] = 0; 448 | } else { 449 | overrides->overrideItemIsEnabled[AlarmStatusBarItem] = 0; 450 | } 451 | 452 | [self applyChanges:overrides]; 453 | } 454 | 455 | - (bool) isLocationHidden { 456 | StatusBarOverrideData *overrides = [self getOverrides]; 457 | return overrides->overrideItemIsEnabled[LocationStatusBarItem] == 1; 458 | } 459 | 460 | - (void) hideLocation:(bool)hidden { 461 | StatusBarOverrideData *overrides = [self getOverrides]; 462 | if (hidden) { 463 | overrides->overrideItemIsEnabled[LocationStatusBarItem] = 1; 464 | overrides->values.itemIsEnabled[LocationStatusBarItem] = 0; 465 | } else { 466 | overrides->overrideItemIsEnabled[LocationStatusBarItem] = 0; 467 | } 468 | 469 | [self applyChanges:overrides]; 470 | } 471 | 472 | - (bool) isRotationHidden { 473 | StatusBarOverrideData *overrides = [self getOverrides]; 474 | return overrides->overrideItemIsEnabled[RotationLockStatusBarItem] == 1; 475 | } 476 | 477 | - (void) hideRotation:(bool)hidden { 478 | StatusBarOverrideData *overrides = [self getOverrides]; 479 | if (hidden) { 480 | overrides->overrideItemIsEnabled[RotationLockStatusBarItem] = 1; 481 | overrides->values.itemIsEnabled[RotationLockStatusBarItem] = 0; 482 | } else { 483 | overrides->overrideItemIsEnabled[RotationLockStatusBarItem] = 0; 484 | } 485 | 486 | [self applyChanges:overrides]; 487 | } 488 | 489 | - (bool) isAirPlayHidden { 490 | StatusBarOverrideData *overrides = [self getOverrides]; 491 | return overrides->overrideItemIsEnabled[AirPlayStatusBarItem] == 1; 492 | } 493 | 494 | - (void) hideAirPlay:(bool)hidden { 495 | StatusBarOverrideData *overrides = [self getOverrides]; 496 | if (hidden) { 497 | overrides->overrideItemIsEnabled[AirPlayStatusBarItem] = 1; 498 | overrides->values.itemIsEnabled[AirPlayStatusBarItem] = 0; 499 | } else { 500 | overrides->overrideItemIsEnabled[AirPlayStatusBarItem] = 0; 501 | } 502 | 503 | [self applyChanges:overrides]; 504 | } 505 | 506 | - (bool) isCarPlayHidden { 507 | StatusBarOverrideData *overrides = [self getOverrides]; 508 | return overrides->overrideItemIsEnabled[CarPlayStatusBarItem] == 1; 509 | } 510 | 511 | - (void) hideCarPlay:(bool)hidden { 512 | StatusBarOverrideData *overrides = [self getOverrides]; 513 | if (hidden) { 514 | overrides->overrideItemIsEnabled[CarPlayStatusBarItem] = 1; 515 | overrides->values.itemIsEnabled[CarPlayStatusBarItem] = 0; 516 | } else { 517 | overrides->overrideItemIsEnabled[CarPlayStatusBarItem] = 0; 518 | } 519 | 520 | [self applyChanges:overrides]; 521 | } 522 | 523 | - (bool) isVPNHidden { 524 | StatusBarOverrideData *overrides = [self getOverrides]; 525 | return overrides->overrideItemIsEnabled[VPNStatusBarItem] == 1; 526 | } 527 | 528 | - (void) hideVPN:(bool)hidden { 529 | StatusBarOverrideData *overrides = [self getOverrides]; 530 | if (hidden) { 531 | overrides->overrideItemIsEnabled[VPNStatusBarItem] = 1; 532 | overrides->values.itemIsEnabled[VPNStatusBarItem] = 0; 533 | } else { 534 | overrides->overrideItemIsEnabled[VPNStatusBarItem] = 0; 535 | } 536 | 537 | [self applyChanges:overrides]; 538 | } 539 | 540 | - (bool) isMicrophoneUseHidden { 541 | StatusBarOverrideData *overrides = [self getOverrides]; 542 | return overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] == 1; 543 | } 544 | 545 | - (void) hideMicrophoneUse:(bool)hidden { 546 | StatusBarOverrideData *overrides = [self getOverrides]; 547 | if (hidden) { 548 | overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] = 1; 549 | overrides->values.itemIsEnabled[MicrophoneUseStatusBarItem] = 0; 550 | } else { 551 | overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] = 0; 552 | } 553 | 554 | [self applyChanges:overrides]; 555 | } 556 | 557 | - (bool) isCameraUseHidden { 558 | StatusBarOverrideData *overrides = [self getOverrides]; 559 | return overrides->overrideItemIsEnabled[CameraUseStatusBarItem] == 1; 560 | } 561 | 562 | - (void) hideCameraUse:(bool)hidden { 563 | StatusBarOverrideData *overrides = [self getOverrides]; 564 | if (hidden) { 565 | overrides->overrideItemIsEnabled[CameraUseStatusBarItem] = 1; 566 | overrides->values.itemIsEnabled[CameraUseStatusBarItem] = 0; 567 | } else { 568 | overrides->overrideItemIsEnabled[CameraUseStatusBarItem] = 0; 569 | } 570 | 571 | [self applyChanges:overrides]; 572 | } 573 | 574 | @end 575 | -------------------------------------------------------------------------------- /SecondHand/StatusMagic/iOS16/StatusSetter16.m: -------------------------------------------------------------------------------- 1 | #import "StatusSetter16.h" 2 | #import "StatusManager.h" 3 | 4 | typedef NS_ENUM(int, StatusBarItem) { 5 | TimeStatusBarItem = 0, 6 | DateStatusBarItem = 1, 7 | QuietModeStatusBarItem = 2, 8 | AirplaneModeStatusBarItem = 3, 9 | CellularSignalStrengthStatusBarItem = 4, 10 | SecondaryCellularSignalStrengthStatusBarItem = 5, 11 | CellularServiceStatusBarItem = 6, 12 | SecondaryCellularServiceStatusBarItem = 7, 13 | // 8 14 | CellularDataNetworkStatusBarItem = 9, 15 | SecondaryCellularDataNetworkStatusBarItem = 10, 16 | // 11 17 | MainBatteryStatusBarItem = 12, 18 | ProminentlyShowBatteryDetailStatusBarItem = 13, 19 | // 14 20 | // 15 21 | BluetoothStatusBarItem = 16, 22 | TTYStatusBarItem = 17, 23 | AlarmStatusBarItem = 18, 24 | // 19 25 | // 20 26 | LocationStatusBarItem = 21, 27 | RotationLockStatusBarItem = 22, 28 | CameraUseStatusBarItem = 23, 29 | AirPlayStatusBarItem = 24, 30 | AssistantStatusBarItem = 25, 31 | CarPlayStatusBarItem = 26, 32 | StudentStatusBarItem = 27, 33 | MicrophoneUseStatusBarItem = 28, 34 | VPNStatusBarItem = 29, 35 | // 30 36 | // 31 37 | // 32 38 | // 33 39 | // 34 40 | // 35 41 | // 36 42 | // 37 43 | LiquidDetectionStatusBarItem = 38, 44 | VoiceControlStatusBarItem = 39, 45 | // 40 46 | // 41 47 | // 42 48 | // 43 49 | Extra1StatusBarItem = 44, 50 | }; 51 | 52 | typedef NS_ENUM(unsigned int, BatteryState) { 53 | BatteryStateUnplugged = 0 54 | }; 55 | 56 | typedef struct { 57 | bool itemIsEnabled[45]; 58 | char timeString[64]; 59 | char shortTimeString[64]; 60 | char dateString[256]; 61 | int gsmSignalStrengthRaw; 62 | int secondaryGsmSignalStrengthRaw; 63 | int gsmSignalStrengthBars; 64 | int secondaryGsmSignalStrengthBars; 65 | char serviceString[100]; 66 | char secondaryServiceString[100]; 67 | char serviceCrossfadeString[100]; 68 | char secondaryServiceCrossfadeString[100]; 69 | char serviceImages[2][100]; 70 | char operatorDirectory[1024]; 71 | unsigned int serviceContentType; 72 | unsigned int secondaryServiceContentType; 73 | unsigned int cellLowDataModeActive:1; 74 | unsigned int secondaryCellLowDataModeActive:1; 75 | int wifiSignalStrengthRaw; 76 | int wifiSignalStrengthBars; 77 | unsigned int wifiLowDataModeActive:1; 78 | unsigned int dataNetworkType; 79 | unsigned int secondaryDataNetworkType; 80 | int batteryCapacity; 81 | unsigned int batteryState; 82 | char batteryDetailString[150]; 83 | int bluetoothBatteryCapacity; 84 | int thermalColor; 85 | unsigned int thermalSunlightMode : 1; 86 | unsigned int slowActivity : 1; 87 | unsigned int syncActivity : 1; 88 | char activityDisplayId[256]; 89 | unsigned int bluetoothConnected : 1; 90 | unsigned int displayRawGSMSignal : 1; 91 | unsigned int displayRawWifiSignal : 1; 92 | unsigned int locationIconType : 1; 93 | unsigned int voiceControlIconType:2; 94 | unsigned int quietModeInactive : 1; 95 | unsigned int tetheringConnectionCount; 96 | unsigned int batterySaverModeActive : 1; 97 | unsigned int deviceIsRTL : 1; 98 | unsigned int lock : 1; 99 | char breadcrumbTitle[256]; 100 | char breadcrumbSecondaryTitle[256]; 101 | char personName[100]; 102 | unsigned int electronicTollCollectionAvailable : 1; 103 | unsigned int radarAvailable : 1; 104 | unsigned int wifiLinkWarning : 1; 105 | unsigned int wifiSearching : 1; 106 | double backgroundActivityDisplayStartDate; 107 | unsigned int shouldShowEmergencyOnlyStatus : 1; 108 | unsigned int secondaryCellularConfigured : 1; 109 | char primaryServiceBadgeString[100]; 110 | char secondaryServiceBadgeString[100]; 111 | char quietModeImage[256]; 112 | unsigned int extra1 : 1; // Unsure of actual size, but it's at least 1 byte. Since this is at the end of the struct, and we aren't modifying this part of the struct, it likely shouldn't matter that it's not the correct size. 113 | } StatusBarRawData; 114 | 115 | typedef struct { 116 | bool overrideItemIsEnabled[45]; 117 | unsigned int overrideTimeString : 1; 118 | unsigned int overrideDateString : 1; 119 | unsigned int overrideGsmSignalStrengthRaw : 1; 120 | unsigned int overrideSecondaryGsmSignalStrengthRaw : 1; 121 | unsigned int overrideGsmSignalStrengthBars : 1; 122 | unsigned int overrideSecondaryGsmSignalStrengthBars : 1; 123 | unsigned int overrideServiceString : 1; 124 | unsigned int overrideSecondaryServiceString : 1; 125 | unsigned int overrideServiceImages : 2; 126 | unsigned int overrideOperatorDirectory : 1; 127 | unsigned int overrideServiceContentType : 1; 128 | unsigned int overrideSecondaryServiceContentType : 1; 129 | unsigned int overrideWifiSignalStrengthRaw : 1; 130 | unsigned int overrideWifiSignalStrengthBars : 1; 131 | unsigned int overrideDataNetworkType : 1; 132 | unsigned int overrideSecondaryDataNetworkType : 1; 133 | unsigned int disallowsCellularDataNetworkTypes : 1; 134 | unsigned int overrideBatteryCapacity : 1; 135 | unsigned int overrideBatteryState : 1; 136 | unsigned int overrideBatteryDetailString : 1; 137 | unsigned int overrideBluetoothBatteryCapacity : 1; 138 | unsigned int overrideThermalColor : 1; 139 | unsigned int overrideSlowActivity : 1; 140 | unsigned int overrideActivityDisplayId : 1; 141 | unsigned int overrideBluetoothConnected : 1; 142 | unsigned int overrideBreadcrumb : 1; 143 | unsigned int overrideLock; 144 | unsigned int overrideDisplayRawGSMSignal : 1; 145 | unsigned int overrideDisplayRawWifiSignal : 1; 146 | unsigned int overridePersonName : 1; 147 | unsigned int overrideWifiLinkWarning : 1; 148 | unsigned int overrideSecondaryCellularConfigured : 1; 149 | unsigned int overridePrimaryServiceBadgeString : 1; 150 | unsigned int overrideSecondaryServiceBadgeString : 1; 151 | unsigned int overrideQuietModeImage : 1; 152 | unsigned int overrideExtra1 : 1; // Not sure what this is, but there only seems to be one of them 153 | StatusBarRawData values; 154 | } StatusBarOverrideData; 155 | 156 | @class UIStatusBarServer; 157 | 158 | @protocol UIStatusBarServerClient 159 | 160 | @required 161 | 162 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveDoubleHeightStatusString:(NSString *)arg2 forStyle:(long long)arg3; 163 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveGlowAnimationState:(bool)arg2 forStyle:(long long)arg3; 164 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveStatusBarData:(const StatusBarRawData *)arg2 withActions:(int)arg3; 165 | - (void)statusBarServer:(UIStatusBarServer *)arg1 didReceiveStyleOverrides:(int)arg2; 166 | 167 | @end 168 | 169 | @interface UIStatusBarServer : NSObject 170 | 171 | @property (nonatomic, strong) id statusBar; 172 | 173 | + (void)postStatusBarOverrideData:(StatusBarOverrideData *)arg1; 174 | + (void)permanentizeStatusBarOverrideData; 175 | + (StatusBarOverrideData *)getStatusBarOverrideData; 176 | 177 | @end 178 | 179 | @implementation StatusSetter16 180 | 181 | // BELOW IS THE SAME IN iOS 15, 16, 16.1, and 16.3 182 | 183 | - (void) applyChanges:(StatusBarOverrideData*)overrides { 184 | if (!StatusManager.sharedInstance.isMDCMode) { 185 | [UIStatusBarServer postStatusBarOverrideData:overrides]; 186 | [UIStatusBarServer permanentizeStatusBarOverrideData]; 187 | } else { 188 | FILE *outfile; 189 | outfile = fopen ("/var/mobile/Library/SpringBoard/statusBarOverridesEditing", "w+"); 190 | if (outfile == NULL) return; 191 | 192 | char padding[256] = {'\0'}; 193 | 194 | fwrite (overrides, sizeof(StatusBarOverrideData), 1, outfile); 195 | fwrite (padding, sizeof(padding), 1, outfile); 196 | 197 | fclose (outfile); 198 | } 199 | } 200 | 201 | - (StatusBarOverrideData*) getOverrides { 202 | if (!StatusManager.sharedInstance.isMDCMode) { 203 | return [UIStatusBarServer getStatusBarOverrideData]; 204 | } else { 205 | NSFileManager *fileManager = [NSFileManager defaultManager]; 206 | NSString *path = @"/var/mobile/Library/SpringBoard/statusBarOverridesEditing"; 207 | if ([fileManager fileExistsAtPath:path]){ 208 | FILE *infile; 209 | NSMutableData* data = [NSMutableData dataWithLength:sizeof(StatusBarOverrideData)]; 210 | StatusBarOverrideData* input = [data mutableBytes]; 211 | infile = fopen ("/var/mobile/Library/SpringBoard/statusBarOverridesEditing", "r"); 212 | if (infile == NULL) return NULL; 213 | if (fread(input, sizeof(StatusBarOverrideData), 1, infile) != 0) { 214 | fclose (infile); 215 | return input; 216 | } 217 | fclose (infile); 218 | return NULL; 219 | } else { 220 | StatusBarOverrideData* overrides = [UIStatusBarServer getStatusBarOverrideData]; 221 | [self applyChanges:overrides]; 222 | return overrides; 223 | } 224 | } 225 | } 226 | 227 | // ALL BELOW HERE IS IDENTICAL IN EACH SETTER 228 | 229 | - (bool) isCarrierOverridden { 230 | StatusBarOverrideData *overrides = [self getOverrides]; 231 | return overrides->overrideServiceString == 1; 232 | } 233 | 234 | - (NSString*) getCarrierOverride { 235 | StatusBarOverrideData *overrides = [self getOverrides]; 236 | NSString* carrier = @(overrides->values.serviceString); 237 | return carrier; 238 | } 239 | 240 | - (void) setCarrier:(NSString*)text { 241 | StatusBarOverrideData *overrides = [self getOverrides]; 242 | overrides->overrideServiceString = 1; 243 | overrides->overrideSecondaryServiceString = 1; 244 | strcpy(overrides->values.serviceString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 245 | strcpy(overrides->values.serviceCrossfadeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 246 | strcpy(overrides->values.secondaryServiceString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 247 | strcpy(overrides->values.secondaryServiceCrossfadeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 248 | [self applyChanges:overrides]; 249 | } 250 | 251 | - (void) unsetCarrier { 252 | StatusBarOverrideData *overrides = [self getOverrides]; 253 | overrides->overrideServiceString = 0; 254 | overrides->overrideSecondaryServiceString = 0; 255 | [self applyChanges:overrides]; 256 | } 257 | 258 | - (bool) isTimeOverridden { 259 | StatusBarOverrideData *overrides = [self getOverrides]; 260 | return overrides->overrideTimeString == 1; 261 | } 262 | 263 | - (NSString*) getTimeOverride { 264 | StatusBarOverrideData *overrides = [self getOverrides]; 265 | NSString* time = @(overrides->values.timeString); 266 | return time; 267 | } 268 | 269 | - (void) setTime:(NSString*)text { 270 | StatusBarOverrideData *overrides = [self getOverrides]; 271 | strcpy(overrides->values.timeString, [text cStringUsingEncoding:NSUTF8StringEncoding]); 272 | overrides->overrideTimeString = 1; 273 | [self applyChanges:overrides]; 274 | } 275 | 276 | - (void) unsetTime { 277 | StatusBarOverrideData *overrides = [self getOverrides]; 278 | overrides->overrideTimeString = 0; 279 | [self applyChanges:overrides]; 280 | } 281 | 282 | - (bool) isCrumbOverridden { 283 | StatusBarOverrideData *overrides = [self getOverrides]; 284 | return overrides->overrideBreadcrumb == 1; 285 | } 286 | 287 | - (NSString*) getCrumbOverride { 288 | StatusBarOverrideData *overrides = [self getOverrides]; 289 | NSString* crumb = @(overrides->values.breadcrumbTitle); 290 | if (crumb.length > 1) { 291 | return [crumb substringToIndex:[crumb length] - 2]; 292 | } else { 293 | return @""; 294 | } 295 | } 296 | 297 | - (void) setCrumb:(NSString*)text { 298 | StatusBarOverrideData *overrides = [self getOverrides]; 299 | overrides->overrideBreadcrumb = 1; 300 | strcpy(overrides->values.breadcrumbTitle, [[text stringByAppendingString:@" ▶"] cStringUsingEncoding:NSUTF8StringEncoding]); 301 | [self applyChanges:overrides]; 302 | } 303 | 304 | - (void) unsetCrumb { 305 | StatusBarOverrideData *overrides = [self getOverrides]; 306 | strcpy(overrides->values.breadcrumbTitle, [@"" cStringUsingEncoding:NSUTF8StringEncoding]); 307 | overrides->overrideBreadcrumb = 0; 308 | [self applyChanges:overrides]; 309 | } 310 | 311 | - (bool) isClockHidden { 312 | StatusBarOverrideData *overrides = [self getOverrides]; 313 | return overrides->overrideItemIsEnabled[TimeStatusBarItem] == 1; 314 | } 315 | 316 | - (void) hideClock:(bool)hidden { 317 | StatusBarOverrideData *overrides = [self getOverrides]; 318 | if (hidden) { 319 | overrides->overrideItemIsEnabled[TimeStatusBarItem] = 1; 320 | overrides->values.itemIsEnabled[TimeStatusBarItem] = 0; 321 | } else { 322 | overrides->overrideItemIsEnabled[TimeStatusBarItem] = 0; 323 | } 324 | 325 | [self applyChanges:overrides]; 326 | } 327 | 328 | - (bool) isDNDHidden { 329 | StatusBarOverrideData *overrides = [self getOverrides]; 330 | return overrides->overrideItemIsEnabled[QuietModeStatusBarItem] == 1; 331 | } 332 | 333 | - (void) hideDND:(bool)hidden { 334 | StatusBarOverrideData *overrides = [self getOverrides]; 335 | if (hidden) { 336 | overrides->overrideItemIsEnabled[QuietModeStatusBarItem] = 1; 337 | overrides->values.itemIsEnabled[QuietModeStatusBarItem] = 0; 338 | } else { 339 | overrides->overrideItemIsEnabled[QuietModeStatusBarItem] = 0; 340 | } 341 | 342 | [self applyChanges:overrides]; 343 | } 344 | 345 | - (bool) isAirplaneHidden { 346 | StatusBarOverrideData *overrides = [self getOverrides]; 347 | return overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] == 1; 348 | } 349 | 350 | - (void) hideAirplane:(bool)hidden { 351 | StatusBarOverrideData *overrides = [self getOverrides]; 352 | if (hidden) { 353 | overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] = 1; 354 | overrides->values.itemIsEnabled[AirplaneModeStatusBarItem] = 0; 355 | } else { 356 | overrides->overrideItemIsEnabled[AirplaneModeStatusBarItem] = 0; 357 | } 358 | 359 | [self applyChanges:overrides]; 360 | } 361 | 362 | - (bool) isCellHidden { 363 | StatusBarOverrideData *overrides = [self getOverrides]; 364 | return overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] == 1; 365 | } 366 | 367 | - (void) hideCell:(bool)hidden { 368 | StatusBarOverrideData *overrides = [self getOverrides]; 369 | if (hidden) { 370 | overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] = 1; 371 | overrides->values.itemIsEnabled[CellularServiceStatusBarItem] = 0; 372 | overrides->overrideItemIsEnabled[SecondaryCellularServiceStatusBarItem] = 1; 373 | overrides->values.itemIsEnabled[SecondaryCellularServiceStatusBarItem] = 0; 374 | } else { 375 | overrides->overrideItemIsEnabled[CellularServiceStatusBarItem] = 0; 376 | overrides->overrideItemIsEnabled[SecondaryCellularServiceStatusBarItem] = 0; 377 | } 378 | 379 | [self applyChanges:overrides]; 380 | } 381 | 382 | - (bool) isWiFiHidden { 383 | StatusBarOverrideData *overrides = [self getOverrides]; 384 | return overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] == 1 && 385 | overrides->overrideItemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] == 1; 386 | } 387 | 388 | - (void) hideWiFi:(bool)hidden { 389 | StatusBarOverrideData *overrides = [self getOverrides]; 390 | if (hidden) { 391 | overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] = 1; 392 | overrides->values.itemIsEnabled[CellularDataNetworkStatusBarItem] = 0; 393 | overrides->overrideItemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 1; 394 | overrides->values.itemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 0; 395 | } else { 396 | overrides->overrideItemIsEnabled[CellularDataNetworkStatusBarItem] = 0; 397 | overrides->overrideItemIsEnabled[SecondaryCellularDataNetworkStatusBarItem] = 0; 398 | } 399 | 400 | [self applyChanges:overrides]; 401 | } 402 | 403 | - (bool) isBatteryHidden { 404 | StatusBarOverrideData *overrides = [self getOverrides]; 405 | return overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] == 1; 406 | } 407 | 408 | - (void) hideBattery:(bool)hidden { 409 | StatusBarOverrideData *overrides = [self getOverrides]; 410 | if (hidden) { 411 | overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] = 1; 412 | overrides->values.itemIsEnabled[MainBatteryStatusBarItem] = 0; 413 | } else { 414 | overrides->overrideItemIsEnabled[MainBatteryStatusBarItem] = 0; 415 | } 416 | 417 | [self applyChanges:overrides]; 418 | } 419 | 420 | - (bool) isBluetoothHidden { 421 | StatusBarOverrideData *overrides = [self getOverrides]; 422 | return overrides->overrideItemIsEnabled[BluetoothStatusBarItem] == 1; 423 | } 424 | 425 | - (void) hideBluetooth:(bool)hidden { 426 | StatusBarOverrideData *overrides = [self getOverrides]; 427 | if (hidden) { 428 | overrides->overrideItemIsEnabled[BluetoothStatusBarItem] = 1; 429 | overrides->values.itemIsEnabled[BluetoothStatusBarItem] = 0; 430 | } else { 431 | overrides->overrideItemIsEnabled[BluetoothStatusBarItem] = 0; 432 | } 433 | 434 | [self applyChanges:overrides]; 435 | } 436 | 437 | - (bool) isAlarmHidden { 438 | StatusBarOverrideData *overrides = [self getOverrides]; 439 | return overrides->overrideItemIsEnabled[AlarmStatusBarItem] == 1; 440 | } 441 | 442 | - (void) hideAlarm:(bool)hidden { 443 | StatusBarOverrideData *overrides = [self getOverrides]; 444 | if (hidden) { 445 | overrides->overrideItemIsEnabled[AlarmStatusBarItem] = 1; 446 | overrides->values.itemIsEnabled[AlarmStatusBarItem] = 0; 447 | } else { 448 | overrides->overrideItemIsEnabled[AlarmStatusBarItem] = 0; 449 | } 450 | 451 | [self applyChanges:overrides]; 452 | } 453 | 454 | - (bool) isLocationHidden { 455 | StatusBarOverrideData *overrides = [self getOverrides]; 456 | return overrides->overrideItemIsEnabled[LocationStatusBarItem] == 1; 457 | } 458 | 459 | - (void) hideLocation:(bool)hidden { 460 | StatusBarOverrideData *overrides = [self getOverrides]; 461 | if (hidden) { 462 | overrides->overrideItemIsEnabled[LocationStatusBarItem] = 1; 463 | overrides->values.itemIsEnabled[LocationStatusBarItem] = 0; 464 | } else { 465 | overrides->overrideItemIsEnabled[LocationStatusBarItem] = 0; 466 | } 467 | 468 | [self applyChanges:overrides]; 469 | } 470 | 471 | - (bool) isRotationHidden { 472 | StatusBarOverrideData *overrides = [self getOverrides]; 473 | return overrides->overrideItemIsEnabled[RotationLockStatusBarItem] == 1; 474 | } 475 | 476 | - (void) hideRotation:(bool)hidden { 477 | StatusBarOverrideData *overrides = [self getOverrides]; 478 | if (hidden) { 479 | overrides->overrideItemIsEnabled[RotationLockStatusBarItem] = 1; 480 | overrides->values.itemIsEnabled[RotationLockStatusBarItem] = 0; 481 | } else { 482 | overrides->overrideItemIsEnabled[RotationLockStatusBarItem] = 0; 483 | } 484 | 485 | [self applyChanges:overrides]; 486 | } 487 | 488 | - (bool) isAirPlayHidden { 489 | StatusBarOverrideData *overrides = [self getOverrides]; 490 | return overrides->overrideItemIsEnabled[AirPlayStatusBarItem] == 1; 491 | } 492 | 493 | - (void) hideAirPlay:(bool)hidden { 494 | StatusBarOverrideData *overrides = [self getOverrides]; 495 | if (hidden) { 496 | overrides->overrideItemIsEnabled[AirPlayStatusBarItem] = 1; 497 | overrides->values.itemIsEnabled[AirPlayStatusBarItem] = 0; 498 | } else { 499 | overrides->overrideItemIsEnabled[AirPlayStatusBarItem] = 0; 500 | } 501 | 502 | [self applyChanges:overrides]; 503 | } 504 | 505 | - (bool) isCarPlayHidden { 506 | StatusBarOverrideData *overrides = [self getOverrides]; 507 | return overrides->overrideItemIsEnabled[CarPlayStatusBarItem] == 1; 508 | } 509 | 510 | - (void) hideCarPlay:(bool)hidden { 511 | StatusBarOverrideData *overrides = [self getOverrides]; 512 | if (hidden) { 513 | overrides->overrideItemIsEnabled[CarPlayStatusBarItem] = 1; 514 | overrides->values.itemIsEnabled[CarPlayStatusBarItem] = 0; 515 | } else { 516 | overrides->overrideItemIsEnabled[CarPlayStatusBarItem] = 0; 517 | } 518 | 519 | [self applyChanges:overrides]; 520 | } 521 | 522 | - (bool) isVPNHidden { 523 | StatusBarOverrideData *overrides = [self getOverrides]; 524 | return overrides->overrideItemIsEnabled[VPNStatusBarItem] == 1; 525 | } 526 | 527 | - (void) hideVPN:(bool)hidden { 528 | StatusBarOverrideData *overrides = [self getOverrides]; 529 | if (hidden) { 530 | overrides->overrideItemIsEnabled[VPNStatusBarItem] = 1; 531 | overrides->values.itemIsEnabled[VPNStatusBarItem] = 0; 532 | } else { 533 | overrides->overrideItemIsEnabled[VPNStatusBarItem] = 0; 534 | } 535 | 536 | [self applyChanges:overrides]; 537 | } 538 | 539 | - (bool) isMicrophoneUseHidden { 540 | StatusBarOverrideData *overrides = [self getOverrides]; 541 | return overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] == 1; 542 | } 543 | 544 | - (void) hideMicrophoneUse:(bool)hidden { 545 | StatusBarOverrideData *overrides = [self getOverrides]; 546 | if (hidden) { 547 | overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] = 1; 548 | overrides->values.itemIsEnabled[MicrophoneUseStatusBarItem] = 0; 549 | } else { 550 | overrides->overrideItemIsEnabled[MicrophoneUseStatusBarItem] = 0; 551 | } 552 | 553 | [self applyChanges:overrides]; 554 | } 555 | 556 | - (bool) isCameraUseHidden { 557 | StatusBarOverrideData *overrides = [self getOverrides]; 558 | return overrides->overrideItemIsEnabled[CameraUseStatusBarItem] == 1; 559 | } 560 | 561 | - (void) hideCameraUse:(bool)hidden { 562 | StatusBarOverrideData *overrides = [self getOverrides]; 563 | if (hidden) { 564 | overrides->overrideItemIsEnabled[CameraUseStatusBarItem] = 1; 565 | overrides->values.itemIsEnabled[CameraUseStatusBarItem] = 0; 566 | } else { 567 | overrides->overrideItemIsEnabled[CameraUseStatusBarItem] = 0; 568 | } 569 | 570 | [self applyChanges:overrides]; 571 | } 572 | 573 | @end 574 | -------------------------------------------------------------------------------- /SecondHand.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6F24806A29B1A0B000F2DAA2 /* SecondHandApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F24806929B1A0B000F2DAA2 /* SecondHandApp.swift */; }; 11 | 6F24806C29B1A0B000F2DAA2 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F24806B29B1A0B000F2DAA2 /* ContentView.swift */; }; 12 | 6F24806E29B1A0B100F2DAA2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6F24806D29B1A0B100F2DAA2 /* Assets.xcassets */; }; 13 | 6F24807129B1A0B100F2DAA2 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6F24807029B1A0B100F2DAA2 /* Preview Assets.xcassets */; }; 14 | 6F24807B29B1A11E00F2DAA2 /* ApplicationMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F24807829B1A11E00F2DAA2 /* ApplicationMonitor.swift */; }; 15 | 6F24807C29B1A11E00F2DAA2 /* BackgroundFileUpdaterController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F24807929B1A11E00F2DAA2 /* BackgroundFileUpdaterController.swift */; }; 16 | 6F24807D29B1A11E00F2DAA2 /* LocationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F24807A29B1A11E00F2DAA2 /* LocationManager.swift */; }; 17 | 6F24808B29B1A29100F2DAA2 /* StatusSetter16_1.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F24808029B1A29100F2DAA2 /* StatusSetter16_1.m */; }; 18 | 6F24808C29B1A29100F2DAA2 /* StatusManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F24808129B1A29100F2DAA2 /* StatusManager.m */; }; 19 | 6F24808D29B1A29100F2DAA2 /* StatusSetter14.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F24808329B1A29100F2DAA2 /* StatusSetter14.m */; }; 20 | 6F24808E29B1A29100F2DAA2 /* StatusSetter15.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F24808429B1A29100F2DAA2 /* StatusSetter15.m */; }; 21 | 6F24808F29B1A29100F2DAA2 /* StatusSetter16.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F24808829B1A29100F2DAA2 /* StatusSetter16.m */; }; 22 | 6F24809129B1A41700F2DAA2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F24809029B1A41700F2DAA2 /* AppDelegate.swift */; }; 23 | 6F24809F29B1A7CA00F2DAA2 /* SecondHand.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = 6F24809E29B1A7C900F2DAA2 /* SecondHand.entitlements */; }; 24 | 6F2480A329B2812500F2DAA2 /* Alert++.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2480A229B2812500F2DAA2 /* Alert++.swift */; }; 25 | 6F2480A529B2813600F2DAA2 /* String++.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2480A429B2813600F2DAA2 /* String++.swift */; }; 26 | 6F24811429BBEAB100F2DAA2 /* Bundle++.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F24811329BBEAB100F2DAA2 /* Bundle++.swift */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 6F24806629B1A0B000F2DAA2 /* SecondHand.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SecondHand.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 6F24806929B1A0B000F2DAA2 /* SecondHandApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondHandApp.swift; sourceTree = ""; }; 32 | 6F24806B29B1A0B000F2DAA2 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 33 | 6F24806D29B1A0B100F2DAA2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 34 | 6F24807029B1A0B100F2DAA2 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 35 | 6F24807829B1A11E00F2DAA2 /* ApplicationMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApplicationMonitor.swift; sourceTree = ""; }; 36 | 6F24807929B1A11E00F2DAA2 /* BackgroundFileUpdaterController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BackgroundFileUpdaterController.swift; sourceTree = ""; }; 37 | 6F24807A29B1A11E00F2DAA2 /* LocationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationManager.swift; sourceTree = ""; }; 38 | 6F24807F29B1A29000F2DAA2 /* SecondHand-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SecondHand-Bridging-Header.h"; sourceTree = ""; }; 39 | 6F24808029B1A29100F2DAA2 /* StatusSetter16_1.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusSetter16_1.m; sourceTree = ""; }; 40 | 6F24808129B1A29100F2DAA2 /* StatusManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusManager.m; sourceTree = ""; }; 41 | 6F24808229B1A29100F2DAA2 /* StatusSetter14.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusSetter14.h; sourceTree = ""; }; 42 | 6F24808329B1A29100F2DAA2 /* StatusSetter14.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusSetter14.m; sourceTree = ""; }; 43 | 6F24808429B1A29100F2DAA2 /* StatusSetter15.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusSetter15.m; sourceTree = ""; }; 44 | 6F24808529B1A29100F2DAA2 /* StatusSetter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusSetter.h; sourceTree = ""; }; 45 | 6F24808629B1A29100F2DAA2 /* StatusSetter16_1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusSetter16_1.h; sourceTree = ""; }; 46 | 6F24808729B1A29100F2DAA2 /* StatusSetter16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusSetter16.h; sourceTree = ""; }; 47 | 6F24808829B1A29100F2DAA2 /* StatusSetter16.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusSetter16.m; sourceTree = ""; }; 48 | 6F24808929B1A29100F2DAA2 /* StatusSetter15.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusSetter15.h; sourceTree = ""; }; 49 | 6F24808A29B1A29100F2DAA2 /* StatusManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusManager.h; sourceTree = ""; }; 50 | 6F24809029B1A41700F2DAA2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 51 | 6F24809E29B1A7C900F2DAA2 /* SecondHand.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = SecondHand.entitlements; sourceTree = ""; }; 52 | 6F2480A029B2298200F2DAA2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 53 | 6F2480A229B2812500F2DAA2 /* Alert++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Alert++.swift"; sourceTree = ""; }; 54 | 6F2480A429B2813600F2DAA2 /* String++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String++.swift"; sourceTree = ""; }; 55 | 6F24811329BBEAB100F2DAA2 /* Bundle++.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle++.swift"; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 6F24806329B1A0B000F2DAA2 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 6F24805D29B1A0B000F2DAA2 = { 70 | isa = PBXGroup; 71 | children = ( 72 | 6F24806829B1A0B000F2DAA2 /* SecondHand */, 73 | 6F24806729B1A0B000F2DAA2 /* Products */, 74 | ); 75 | sourceTree = ""; 76 | }; 77 | 6F24806729B1A0B000F2DAA2 /* Products */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 6F24806629B1A0B000F2DAA2 /* SecondHand.app */, 81 | ); 82 | name = Products; 83 | sourceTree = ""; 84 | }; 85 | 6F24806829B1A0B000F2DAA2 /* SecondHand */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 6F24811529BBEABD00F2DAA2 /* App */, 89 | 6F24807729B1A0E900F2DAA2 /* Controllers */, 90 | 6F2480A129B2810300F2DAA2 /* Extensions */, 91 | 6F24807E29B1A28300F2DAA2 /* StatusMagic */, 92 | 6F2480A029B2298200F2DAA2 /* Info.plist */, 93 | 6F24809E29B1A7C900F2DAA2 /* SecondHand.entitlements */, 94 | 6F24807F29B1A29000F2DAA2 /* SecondHand-Bridging-Header.h */, 95 | 6F24806B29B1A0B000F2DAA2 /* ContentView.swift */, 96 | 6F24806D29B1A0B100F2DAA2 /* Assets.xcassets */, 97 | 6F24806F29B1A0B100F2DAA2 /* Preview Content */, 98 | ); 99 | path = SecondHand; 100 | sourceTree = ""; 101 | }; 102 | 6F24806F29B1A0B100F2DAA2 /* Preview Content */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 6F24807029B1A0B100F2DAA2 /* Preview Assets.xcassets */, 106 | ); 107 | path = "Preview Content"; 108 | sourceTree = ""; 109 | }; 110 | 6F24807729B1A0E900F2DAA2 /* Controllers */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 6F24807829B1A11E00F2DAA2 /* ApplicationMonitor.swift */, 114 | 6F24807929B1A11E00F2DAA2 /* BackgroundFileUpdaterController.swift */, 115 | 6F24807A29B1A11E00F2DAA2 /* LocationManager.swift */, 116 | ); 117 | path = Controllers; 118 | sourceTree = ""; 119 | }; 120 | 6F24807E29B1A28300F2DAA2 /* StatusMagic */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 6F6CAFB72ACB551900151C9B /* MainFunctions */, 124 | 6F6CAFB22ACB54E700151C9B /* iOS14 */, 125 | 6F6CAFB62ACB550E00151C9B /* iOS15 */, 126 | 6F6CAFB52ACB550800151C9B /* iOS16 */, 127 | 6F6CAFB42ACB54FC00151C9B /* iOS16_1 */, 128 | ); 129 | path = StatusMagic; 130 | sourceTree = ""; 131 | }; 132 | 6F2480A129B2810300F2DAA2 /* Extensions */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 6F2480A229B2812500F2DAA2 /* Alert++.swift */, 136 | 6F24811329BBEAB100F2DAA2 /* Bundle++.swift */, 137 | 6F2480A429B2813600F2DAA2 /* String++.swift */, 138 | ); 139 | path = Extensions; 140 | sourceTree = ""; 141 | }; 142 | 6F24811529BBEABD00F2DAA2 /* App */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 6F24809029B1A41700F2DAA2 /* AppDelegate.swift */, 146 | 6F24806929B1A0B000F2DAA2 /* SecondHandApp.swift */, 147 | ); 148 | path = App; 149 | sourceTree = ""; 150 | }; 151 | 6F6CAFB22ACB54E700151C9B /* iOS14 */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 6F24808229B1A29100F2DAA2 /* StatusSetter14.h */, 155 | 6F24808329B1A29100F2DAA2 /* StatusSetter14.m */, 156 | ); 157 | path = iOS14; 158 | sourceTree = ""; 159 | }; 160 | 6F6CAFB42ACB54FC00151C9B /* iOS16_1 */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | 6F24808629B1A29100F2DAA2 /* StatusSetter16_1.h */, 164 | 6F24808029B1A29100F2DAA2 /* StatusSetter16_1.m */, 165 | ); 166 | path = iOS16_1; 167 | sourceTree = ""; 168 | }; 169 | 6F6CAFB52ACB550800151C9B /* iOS16 */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | 6F24808729B1A29100F2DAA2 /* StatusSetter16.h */, 173 | 6F24808829B1A29100F2DAA2 /* StatusSetter16.m */, 174 | ); 175 | path = iOS16; 176 | sourceTree = ""; 177 | }; 178 | 6F6CAFB62ACB550E00151C9B /* iOS15 */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | 6F24808929B1A29100F2DAA2 /* StatusSetter15.h */, 182 | 6F24808429B1A29100F2DAA2 /* StatusSetter15.m */, 183 | ); 184 | path = iOS15; 185 | sourceTree = ""; 186 | }; 187 | 6F6CAFB72ACB551900151C9B /* MainFunctions */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 6F24808A29B1A29100F2DAA2 /* StatusManager.h */, 191 | 6F24808129B1A29100F2DAA2 /* StatusManager.m */, 192 | 6F24808529B1A29100F2DAA2 /* StatusSetter.h */, 193 | ); 194 | path = MainFunctions; 195 | sourceTree = ""; 196 | }; 197 | /* End PBXGroup section */ 198 | 199 | /* Begin PBXNativeTarget section */ 200 | 6F24806529B1A0B000F2DAA2 /* SecondHand */ = { 201 | isa = PBXNativeTarget; 202 | buildConfigurationList = 6F24807429B1A0B100F2DAA2 /* Build configuration list for PBXNativeTarget "SecondHand" */; 203 | buildPhases = ( 204 | 6F24806229B1A0B000F2DAA2 /* Sources */, 205 | 6F24806329B1A0B000F2DAA2 /* Frameworks */, 206 | 6F24806429B1A0B000F2DAA2 /* Resources */, 207 | ); 208 | buildRules = ( 209 | ); 210 | dependencies = ( 211 | ); 212 | name = SecondHand; 213 | productName = SecondHand; 214 | productReference = 6F24806629B1A0B000F2DAA2 /* SecondHand.app */; 215 | productType = "com.apple.product-type.application"; 216 | }; 217 | /* End PBXNativeTarget section */ 218 | 219 | /* Begin PBXProject section */ 220 | 6F24805E29B1A0B000F2DAA2 /* Project object */ = { 221 | isa = PBXProject; 222 | attributes = { 223 | BuildIndependentTargetsInParallel = 1; 224 | LastSwiftUpdateCheck = 1420; 225 | LastUpgradeCheck = 1420; 226 | TargetAttributes = { 227 | 6F24806529B1A0B000F2DAA2 = { 228 | CreatedOnToolsVersion = 14.2; 229 | LastSwiftMigration = 1420; 230 | }; 231 | }; 232 | }; 233 | buildConfigurationList = 6F24806129B1A0B000F2DAA2 /* Build configuration list for PBXProject "SecondHand" */; 234 | compatibilityVersion = "Xcode 14.0"; 235 | developmentRegion = en; 236 | hasScannedForEncodings = 0; 237 | knownRegions = ( 238 | en, 239 | Base, 240 | ); 241 | mainGroup = 6F24805D29B1A0B000F2DAA2; 242 | productRefGroup = 6F24806729B1A0B000F2DAA2 /* Products */; 243 | projectDirPath = ""; 244 | projectRoot = ""; 245 | targets = ( 246 | 6F24806529B1A0B000F2DAA2 /* SecondHand */, 247 | ); 248 | }; 249 | /* End PBXProject section */ 250 | 251 | /* Begin PBXResourcesBuildPhase section */ 252 | 6F24806429B1A0B000F2DAA2 /* Resources */ = { 253 | isa = PBXResourcesBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | 6F24809F29B1A7CA00F2DAA2 /* SecondHand.entitlements in Resources */, 257 | 6F24807129B1A0B100F2DAA2 /* Preview Assets.xcassets in Resources */, 258 | 6F24806E29B1A0B100F2DAA2 /* Assets.xcassets in Resources */, 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | }; 262 | /* End PBXResourcesBuildPhase section */ 263 | 264 | /* Begin PBXSourcesBuildPhase section */ 265 | 6F24806229B1A0B000F2DAA2 /* Sources */ = { 266 | isa = PBXSourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | 6F24809129B1A41700F2DAA2 /* AppDelegate.swift in Sources */, 270 | 6F24806C29B1A0B000F2DAA2 /* ContentView.swift in Sources */, 271 | 6F24808C29B1A29100F2DAA2 /* StatusManager.m in Sources */, 272 | 6F24807C29B1A11E00F2DAA2 /* BackgroundFileUpdaterController.swift in Sources */, 273 | 6F24808F29B1A29100F2DAA2 /* StatusSetter16.m in Sources */, 274 | 6F2480A529B2813600F2DAA2 /* String++.swift in Sources */, 275 | 6F24808E29B1A29100F2DAA2 /* StatusSetter15.m in Sources */, 276 | 6F24808D29B1A29100F2DAA2 /* StatusSetter14.m in Sources */, 277 | 6F24807D29B1A11E00F2DAA2 /* LocationManager.swift in Sources */, 278 | 6F24811429BBEAB100F2DAA2 /* Bundle++.swift in Sources */, 279 | 6F2480A329B2812500F2DAA2 /* Alert++.swift in Sources */, 280 | 6F24808B29B1A29100F2DAA2 /* StatusSetter16_1.m in Sources */, 281 | 6F24807B29B1A11E00F2DAA2 /* ApplicationMonitor.swift in Sources */, 282 | 6F24806A29B1A0B000F2DAA2 /* SecondHandApp.swift in Sources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | /* End PBXSourcesBuildPhase section */ 287 | 288 | /* Begin XCBuildConfiguration section */ 289 | 6F24807229B1A0B100F2DAA2 /* Debug */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | ALWAYS_SEARCH_USER_PATHS = NO; 293 | CLANG_ANALYZER_NONNULL = YES; 294 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 295 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 296 | CLANG_ENABLE_MODULES = YES; 297 | CLANG_ENABLE_OBJC_ARC = YES; 298 | CLANG_ENABLE_OBJC_WEAK = YES; 299 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 300 | CLANG_WARN_BOOL_CONVERSION = YES; 301 | CLANG_WARN_COMMA = YES; 302 | CLANG_WARN_CONSTANT_CONVERSION = YES; 303 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 304 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 305 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 306 | CLANG_WARN_EMPTY_BODY = YES; 307 | CLANG_WARN_ENUM_CONVERSION = YES; 308 | CLANG_WARN_INFINITE_RECURSION = YES; 309 | CLANG_WARN_INT_CONVERSION = YES; 310 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 311 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 312 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 313 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 314 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 315 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 316 | CLANG_WARN_STRICT_PROTOTYPES = YES; 317 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 318 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 319 | CLANG_WARN_UNREACHABLE_CODE = YES; 320 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 321 | COPY_PHASE_STRIP = NO; 322 | DEBUG_INFORMATION_FORMAT = dwarf; 323 | ENABLE_STRICT_OBJC_MSGSEND = YES; 324 | ENABLE_TESTABILITY = YES; 325 | GCC_C_LANGUAGE_STANDARD = gnu11; 326 | GCC_DYNAMIC_NO_PIC = NO; 327 | GCC_NO_COMMON_BLOCKS = YES; 328 | GCC_OPTIMIZATION_LEVEL = 0; 329 | GCC_PREPROCESSOR_DEFINITIONS = ( 330 | "DEBUG=1", 331 | "$(inherited)", 332 | ); 333 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 334 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 335 | GCC_WARN_UNDECLARED_SELECTOR = YES; 336 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 337 | GCC_WARN_UNUSED_FUNCTION = YES; 338 | GCC_WARN_UNUSED_VARIABLE = YES; 339 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 340 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 341 | MTL_FAST_MATH = YES; 342 | ONLY_ACTIVE_ARCH = YES; 343 | SDKROOT = iphoneos; 344 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 345 | SWIFT_OBJC_BRIDGING_HEADER = "SecondHand/SecondHand-Bridging-Header.h"; 346 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 347 | }; 348 | name = Debug; 349 | }; 350 | 6F24807329B1A0B100F2DAA2 /* Release */ = { 351 | isa = XCBuildConfiguration; 352 | buildSettings = { 353 | ALWAYS_SEARCH_USER_PATHS = NO; 354 | CLANG_ANALYZER_NONNULL = YES; 355 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 356 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 357 | CLANG_ENABLE_MODULES = YES; 358 | CLANG_ENABLE_OBJC_ARC = YES; 359 | CLANG_ENABLE_OBJC_WEAK = YES; 360 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 361 | CLANG_WARN_BOOL_CONVERSION = YES; 362 | CLANG_WARN_COMMA = YES; 363 | CLANG_WARN_CONSTANT_CONVERSION = YES; 364 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 365 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 366 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 367 | CLANG_WARN_EMPTY_BODY = YES; 368 | CLANG_WARN_ENUM_CONVERSION = YES; 369 | CLANG_WARN_INFINITE_RECURSION = YES; 370 | CLANG_WARN_INT_CONVERSION = YES; 371 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 372 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 373 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 374 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 375 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 376 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 377 | CLANG_WARN_STRICT_PROTOTYPES = YES; 378 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 379 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 380 | CLANG_WARN_UNREACHABLE_CODE = YES; 381 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 382 | COPY_PHASE_STRIP = NO; 383 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 384 | ENABLE_NS_ASSERTIONS = NO; 385 | ENABLE_STRICT_OBJC_MSGSEND = YES; 386 | GCC_C_LANGUAGE_STANDARD = gnu11; 387 | GCC_NO_COMMON_BLOCKS = YES; 388 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 389 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 390 | GCC_WARN_UNDECLARED_SELECTOR = YES; 391 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 392 | GCC_WARN_UNUSED_FUNCTION = YES; 393 | GCC_WARN_UNUSED_VARIABLE = YES; 394 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 395 | MTL_ENABLE_DEBUG_INFO = NO; 396 | MTL_FAST_MATH = YES; 397 | SDKROOT = iphoneos; 398 | SWIFT_COMPILATION_MODE = wholemodule; 399 | SWIFT_OBJC_BRIDGING_HEADER = "SecondHand/SecondHand-Bridging-Header.h"; 400 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 401 | VALIDATE_PRODUCT = YES; 402 | }; 403 | name = Release; 404 | }; 405 | 6F24807529B1A0B100F2DAA2 /* Debug */ = { 406 | isa = XCBuildConfiguration; 407 | buildSettings = { 408 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 409 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 410 | CLANG_ENABLE_MODULES = YES; 411 | CODE_SIGN_STYLE = Automatic; 412 | CURRENT_PROJECT_VERSION = 1; 413 | DEVELOPMENT_ASSET_PATHS = "\"SecondHand/Preview Content\""; 414 | DEVELOPMENT_TEAM = 2P4CP47H76; 415 | ENABLE_PREVIEWS = YES; 416 | GENERATE_INFOPLIST_FILE = YES; 417 | INFOPLIST_FILE = SecondHand/Info.plist; 418 | INFOPLIST_KEY_CFBundleDisplayName = "Second Hand"; 419 | INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "SecondHand runs in background to keep the time changing. Usually iOS kills such apps after a period of time. But Cowabunga tricks iOS by requesting location data thus allowiing much longer sessions. Data is never stored anywhere, only fetched."; 420 | INFOPLIST_KEY_NSLocationUsageDescription = "SecondHand runs in background to keep the time changing. Usually iOS kills such apps after a period of time. But Cowabunga tricks iOS by requesting location data thus allowiing much longer sessions. Data is never stored anywhere, only fetched."; 421 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 422 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 423 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 424 | INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; 425 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; 426 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 427 | LD_RUNPATH_SEARCH_PATHS = ( 428 | "$(inherited)", 429 | "@executable_path/Frameworks", 430 | ); 431 | MARKETING_VERSION = 1.3.1; 432 | PRODUCT_BUNDLE_IDENTIFIER = com.leemin.SecondHand; 433 | PRODUCT_NAME = "$(TARGET_NAME)"; 434 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; 435 | SUPPORTS_MACCATALYST = NO; 436 | SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; 437 | SWIFT_EMIT_LOC_STRINGS = YES; 438 | SWIFT_OBJC_BRIDGING_HEADER = "SecondHand/SecondHand-Bridging-Header.h"; 439 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 440 | SWIFT_VERSION = 5.0; 441 | TARGETED_DEVICE_FAMILY = "1,2"; 442 | }; 443 | name = Debug; 444 | }; 445 | 6F24807629B1A0B100F2DAA2 /* Release */ = { 446 | isa = XCBuildConfiguration; 447 | buildSettings = { 448 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 449 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 450 | CLANG_ENABLE_MODULES = YES; 451 | CODE_SIGN_STYLE = Automatic; 452 | CURRENT_PROJECT_VERSION = 1; 453 | DEVELOPMENT_ASSET_PATHS = "\"SecondHand/Preview Content\""; 454 | DEVELOPMENT_TEAM = 2P4CP47H76; 455 | ENABLE_PREVIEWS = YES; 456 | GENERATE_INFOPLIST_FILE = YES; 457 | INFOPLIST_FILE = SecondHand/Info.plist; 458 | INFOPLIST_KEY_CFBundleDisplayName = "Second Hand"; 459 | INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "SecondHand runs in background to keep the time changing. Usually iOS kills such apps after a period of time. But Cowabunga tricks iOS by requesting location data thus allowiing much longer sessions. Data is never stored anywhere, only fetched."; 460 | INFOPLIST_KEY_NSLocationUsageDescription = "SecondHand runs in background to keep the time changing. Usually iOS kills such apps after a period of time. But Cowabunga tricks iOS by requesting location data thus allowiing much longer sessions. Data is never stored anywhere, only fetched."; 461 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 462 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 463 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 464 | INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; 465 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; 466 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 467 | LD_RUNPATH_SEARCH_PATHS = ( 468 | "$(inherited)", 469 | "@executable_path/Frameworks", 470 | ); 471 | MARKETING_VERSION = 1.3.1; 472 | PRODUCT_BUNDLE_IDENTIFIER = com.leemin.SecondHand; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; 475 | SUPPORTS_MACCATALYST = NO; 476 | SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; 477 | SWIFT_EMIT_LOC_STRINGS = YES; 478 | SWIFT_OBJC_BRIDGING_HEADER = "SecondHand/SecondHand-Bridging-Header.h"; 479 | SWIFT_VERSION = 5.0; 480 | TARGETED_DEVICE_FAMILY = "1,2"; 481 | }; 482 | name = Release; 483 | }; 484 | /* End XCBuildConfiguration section */ 485 | 486 | /* Begin XCConfigurationList section */ 487 | 6F24806129B1A0B000F2DAA2 /* Build configuration list for PBXProject "SecondHand" */ = { 488 | isa = XCConfigurationList; 489 | buildConfigurations = ( 490 | 6F24807229B1A0B100F2DAA2 /* Debug */, 491 | 6F24807329B1A0B100F2DAA2 /* Release */, 492 | ); 493 | defaultConfigurationIsVisible = 0; 494 | defaultConfigurationName = Release; 495 | }; 496 | 6F24807429B1A0B100F2DAA2 /* Build configuration list for PBXNativeTarget "SecondHand" */ = { 497 | isa = XCConfigurationList; 498 | buildConfigurations = ( 499 | 6F24807529B1A0B100F2DAA2 /* Debug */, 500 | 6F24807629B1A0B100F2DAA2 /* Release */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | /* End XCConfigurationList section */ 506 | }; 507 | rootObject = 6F24805E29B1A0B000F2DAA2 /* Project object */; 508 | } 509 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------