diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..00c9364
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,30 @@
+# OS X
+.DS_Store
+
+# Xcode
+## Build generated
+build/
+DerivedData/
+
+## Various settings
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+xcuserdata/
+
+## Other
+*.moved-aside
+*.xccheckout
+*.xcscmblueprint
+*.xcuserstate
+
+## Obj-C/Swift specific
+*.hmap
+*.ipa
+*.dSYM.zip
+*.dSYM
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..1cf1c35
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2012 Shmoopi LLC
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index 9f2c964..b3db905 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,4 @@
-iOS-System-Services
-===================
+# iOS-System-Services
@@ -7,17 +6,16 @@ iOS-System-Services
-This is a singleton class to gather all available information about a device. It gives you over 75 methods to determine everything about a device, including:
- * Hardware & Network Information
- * Battery Usage
- * Accelerometer Data
- * Disk Usage
- * Running Processes
- * Memory Usage
- * And a complete UDID replacement based on unchanging device information.
+This is a singleton class to gather all available information about a device. It gives you over 60 methods to determine everything about a device, including:
-Installation
-===================
+* Hardware Information
+* Network Information
+* Battery Usage
+* Accelerometer Data
+* Disk Usage
+* Memory Usage
+
+## Installation
[](http://cocoapods.org/pods/SystemServices)
[](http://cocoapods.org/pods/SystemServices)
@@ -27,318 +25,301 @@ iOS System Services is available through [CocoaPods](http://cocoapods.org). To i
it, simply add the following line to your Podfile:
```ruby
-pod 'SystemServices', '~> 1.1.1'
+pod 'SystemServices', '~> 2.0.1'
```
-Changes
-===================
-
-1. Added CocoaPods Support
-2. Fixed Bugs and Addressed Naming Issues
-3. Deprecated Older/Unavailable Methods
-4. Fixed Duplicate Implementations
-5. Removed Constants File and Unnecessary Dependencies
+## Usage
-Available Device Information
-===================
+```objective-c
+// Import System Services
+#import "SystemServices.h"
+// Log all System Information
+NSLog(@"All System Information: %@", [SystemServices sharedServices].allSystemInformation);
```
+
+## Changes
+
+1. Removed Older/Unavailable Methods
+2. Updated Demo Project
+3. Added CocoaPods Support
+4. Fixed Bugs and Addressed Naming Issues
+5. Deprecated Older/Unavailable Methods
+
+## Available Device Information
+
+```objective-c
// System Information
// Properties
-
- /* All System Information in Dictionary Format */
- NSDictionary *allSystemInformation;
-
- /* Hardware Information */
-
- // System Uptime (dd hh mm)
- NSString *systemsUptime;
-
- // Model of Device
- NSString *deviceModel;
-
- // Device Name
- NSString *deviceName;
-
- // System Name
- NSString *systemName;
-
- // System Version
- NSString *systemsVersion;
-
- // System Device Type (Not Formatted = iPhone1,0)
- NSString *systemDeviceTypeNotFormatted;
-
- // System Device Type (Formatted = iPhone 1)
- NSString *systemDeviceTypeFormatted;
-
- // Get the Screen Width (X)
- NSInteger screenWidth;
-
- // Get the Screen Height (Y)
- NSInteger screenHeight;
-
- // Get the Screen Brightness
- float screenBrightness;
-
- // Multitasking enabled?
- BOOL multitaskingEnabled;
-
- // Proximity sensor enabled?
- BOOL proximitySensorEnabled;
-
- // Debugger Attached?
- BOOL debuggerAttached;
-
- // Plugged In?
- BOOL pluggedIn;
-
- /* Jailbreak Check */
-
- // Jailbroken?
- int jailbroken;
-
- /* Processor Information */
-
- // Number of processors
- NSInteger numberProcessors;
-
- // Number of Active Processors
- NSInteger numberActiveProcessors;
-
- // Processor Speed in MHz
- NSInteger processorSpeed;
-
- // Processor Bus Speed in MHz
- NSInteger processorBusSpeed;
-
- /* Accessory Information */
-
- // Are any accessories attached?
- BOOL accessoriesAttached;
-
- // Are headphone attached?
- BOOL headphonesAttached;
-
- // Number of attached accessories
- NSInteger numberAttachedAccessories;
-
- // Name of attached accessory/accessories (seperated by , comma's)
- NSString *nameAttachedAccessories;
-
- /* Carrier Information */
-
- // Carrier Name
- NSString *carrierName;
-
- // Carrier Country
- NSString *carrierCountry;
-
- // Carrier Mobile Country Code
- NSString *carrierMobileCountryCode;
-
- // Carrier ISO Country Code
- NSString *carrierISOCountryCode;
-
- // Carrier Mobile Network Code
- NSString *carrierMobileNetworkCode;
-
- // Carrier Allows VOIP
- BOOL carrierAllowsVOIP;
-
- /* Battery Information */
-
- // Battery Level
- float batteryLevel;
-
- // Charging?
- BOOL charging;
-
- // Fully Charged?
- BOOL fullyCharged;
-
- /* Network Information */
-
- // Get Current IP Address
- NSString *currentIPAddress;
-
- // Get Current MAC Address
- NSString *currentMACAddress;
-
- // Get External IP Address
- NSString *externalIPAddress;
-
- // Get Cell IP Address
- NSString *cellIPAddress;
-
- // Get Cell MAC Address
- NSString *cellMACAddress;
-
- // Get Cell Netmask Address
- NSString *cellNetmaskAddress;
-
- // Get Cell Broadcast Address
- NSString *cellBroadcastAddress;
-
- // Get WiFi IP Address
- NSString *wiFiIPAddress;
-
- // Get WiFi MAC Address
- NSString *wiFiMACAddress;
-
- // Get WiFi Netmask Address
- NSString *wiFiNetmaskAddress;
-
- // Get WiFi Broadcast Address
- NSString *wiFiBroadcastAddress;
-
- // Get WiFi Router Address
- NSString *wiFiRouterAddress;
-
- // Connected to WiFi?
- BOOL connectedToWiFi;
-
- // Connected to Cellular Network?
- BOOL connectedToCellNetwork;
-
- /* Process Information */
-
- // Process ID
- int processID;
-
- // Process Name
- NSString *processName;
-
- // Process Status
- int processStatus;
-
- // Parent Process ID
- int parentPID;
-
- // List of process information including PID's, Names, PPID's, and Status'
- NSMutableArray *processesInformation;
-
- /* Disk Information */
-
- // Total Disk Space
- NSString *diskSpace;
-
- // Total Free Disk Space (Raw)
- NSString *freeDiskSpaceinRaw;
-
- // Total Free Disk Space (Percentage)
- NSString *freeDiskSpaceinPercent;
-
- // Total Used Disk Space (Raw)
- NSString *usedDiskSpaceinRaw;
-
- // Total Used Disk Space (Percentage)
- NSString *usedDiskSpaceinPercent;
-
- // Get the total disk space in long format
- long long longDiskSpace;
-
- // Get the total free disk space in long format
- long long longFreeDiskSpace;
-
- /* Memory Information */
-
- // Total Memory
- double totalMemory;
-
- // Free Memory (Raw)
- double freeMemoryinRaw;
-
- // Free Memory (Percent)
- double freeMemoryinPercent;
-
- // Used Memory (Raw)
- double usedMemoryinRaw;
-
- // Used Memory (Percent)
- double usedMemoryinPercent;
-
- // Active Memory (Raw)
- double activeMemoryinRaw;
-
- // Active Memory (Percent)
- double activeMemoryinPercent;
-
- // Inactive Memory (Raw)
- double inactiveMemoryinRaw;
-
- // Inactive Memory (Percent)
- double inactiveMemoryinPercent;
-
- // Wired Memory (Raw)
- double wiredMemoryinRaw;
-
- // Wired Memory (Percent)
- double wiredMemoryinPercent;
-
- // Purgable Memory (Raw)
- double purgableMemoryinRaw;
-
- // Purgable Memory (Percent)
- double purgableMemoryinPercent;
-
- /* Accelerometer Information */
-
- // Device Orientation
- UIInterfaceOrientation deviceOrientation;
-
- /* Localization Information */
-
- // Country
- NSString *country;
-
- // Language
- NSString *language;
-
- // TimeZone
- NSString *timeZoneSS;
-
- // Currency Symbol
- NSString *currency;
-
- /* Application Information */
-
- // Application Version
- NSString *applicationVersion;
-
- // Clipboard Content
- NSString *clipboardContent;
-
- // Application CPU Usage
- float cpuUsage;
-
- /* Universal Unique Identifiers */
-
- // Unique ID
- NSString *uniqueID;
-
- // Device Signature
- NSString *deviceSignature;
-
- // CFUUID
- NSString *cfuuid;
+
+/* All System Information in Dictionary Format */
+NSDictionary *allSystemInformation;
+
+/* Hardware Information */
+
+// System Uptime (dd hh mm)
+NSString *systemsUptime;
+
+// Model of Device
+NSString *deviceModel;
+
+// Device Name
+NSString *deviceName;
+
+// System Name
+NSString *systemName;
+
+// System Version
+NSString *systemsVersion;
+
+// System Device Type (Not Formatted = iPhone1,0)
+NSString *systemDeviceTypeNotFormatted;
+
+// System Device Type (Formatted = iPhone 1)
+NSString *systemDeviceTypeFormatted;
+
+// Get the Screen Width (X)
+NSInteger screenWidth;
+
+// Get the Screen Height (Y)
+NSInteger screenHeight;
+
+// Get the Screen Brightness
+float screenBrightness;
+
+// Multitasking enabled?
+BOOL multitaskingEnabled;
+
+// Proximity sensor enabled?
+BOOL proximitySensorEnabled;
+
+// Debugger Attached?
+BOOL debuggerAttached;
+
+// Plugged In?
+BOOL pluggedIn;
+
+// Step-Counting Available?
+BOOL stepCountingAvailable;
+
+// Distance Available
+BOOL distanceAvailable;
+
+// Floor Counting Available
+BOOL floorCountingAvailable;
+
+/* Jailbreak Check */
+
+// Jailbroken?
+int jailbroken;
+
+/* Processor Information */
+
+// Number of processors
+NSInteger numberProcessors;
+
+// Number of Active Processors
+NSInteger numberActiveProcessors;
+
+// Processor Usage Information
+NSArray *processorsUsage;
+
+/* Accessory Information */
+
+// Are any accessories attached?
+BOOL accessoriesAttached;
+
+// Are headphone attached?
+BOOL headphonesAttached;
+
+// Number of attached accessories
+NSInteger numberAttachedAccessories;
+
+// Name of attached accessory/accessories (seperated by , comma's)
+NSString *nameAttachedAccessories;
+
+/* Carrier Information */
+
+// Carrier Name
+NSString *carrierName;
+
+// Carrier Country
+NSString *carrierCountry;
+
+// Carrier Mobile Country Code
+NSString *carrierMobileCountryCode;
+
+// Carrier ISO Country Code
+NSString *carrierISOCountryCode;
+
+// Carrier Mobile Network Code
+NSString *carrierMobileNetworkCode;
+
+// Carrier Allows VOIP
+BOOL carrierAllowsVOIP;
+
+/* Battery Information */
+
+// Battery Level
+float batteryLevel;
+
+// Charging?
+BOOL charging;
+
+// Fully Charged?
+BOOL fullyCharged;
+
+/* Network Information */
+
+// Get Current IP Address
+NSString *currentIPAddress;
+
+// Get External IP Address
+NSString *externalIPAddress;
+
+// Get Cell IP Address
+NSString *cellIPAddress;
+
+// Get Cell Netmask Address
+NSString *cellNetmaskAddress;
+
+// Get Cell Broadcast Address
+NSString *cellBroadcastAddress;
+
+// Get WiFi IP Address
+NSString *wiFiIPAddress;
+
+// Get WiFi Netmask Address
+NSString *wiFiNetmaskAddress;
+
+// Get WiFi Broadcast Address
+NSString *wiFiBroadcastAddress;
+
+// Get WiFi Router Address
+NSString *wiFiRouterAddress;
+
+// Connected to WiFi?
+BOOL connectedToWiFi;
+
+// Connected to Cellular Network?
+BOOL connectedToCellNetwork;
+
+/* Process Information */
+
+// Process ID
+int processID;
+
+/* Disk Information */
+
+// Total Disk Space
+NSString *diskSpace;
+
+// Total Free Disk Space (Raw)
+NSString *freeDiskSpaceinRaw;
+
+// Total Free Disk Space (Percentage)
+NSString *freeDiskSpaceinPercent;
+
+// Total Used Disk Space (Raw)
+NSString *usedDiskSpaceinRaw;
+
+// Total Used Disk Space (Percentage)
+NSString *usedDiskSpaceinPercent;
+
+// Get the total disk space in long format
+long long longDiskSpace;
+
+// Get the total free disk space in long format
+long long longFreeDiskSpace;
+
+/* Memory Information */
+
+// Total Memory
+double totalMemory;
+
+// Free Memory (Raw)
+double freeMemoryinRaw;
+
+// Free Memory (Percent)
+double freeMemoryinPercent;
+
+// Used Memory (Raw)
+double usedMemoryinRaw;
+
+// Used Memory (Percent)
+double usedMemoryinPercent;
+
+// Active Memory (Raw)
+double activeMemoryinRaw;
+
+// Active Memory (Percent)
+double activeMemoryinPercent;
+
+// Inactive Memory (Raw)
+double inactiveMemoryinRaw;
+
+// Inactive Memory (Percent)
+double inactiveMemoryinPercent;
+
+// Wired Memory (Raw)
+double wiredMemoryinRaw;
+
+// Wired Memory (Percent)
+double wiredMemoryinPercent;
+
+// Purgable Memory (Raw)
+double purgableMemoryinRaw;
+
+// Purgable Memory (Percent)
+double purgableMemoryinPercent;
+
+/* Accelerometer Information */
+
+// Device Orientation
+UIInterfaceOrientation deviceOrientation;
+
+/* Localization Information */
+
+// Country
+NSString *country;
+
+// Language
+NSString *language;
+
+// TimeZone
+NSString *timeZoneSS;
+
+// Currency Symbol
+NSString *currency;
+
+/* Application Information */
+
+// Application Version
+NSString *applicationVersion;
+
+// Clipboard Content
+NSString *clipboardContent;
+
+// Application CPU Usage
+float applicationCPUUsage;
+
+/* Universal Unique Identifiers */
+
+// CFUUID
+NSString *cfuuid;
```
-Third-Party Plugins
-===================
-A big thank you to the makers of:
- * Annotated Gauge iOS Class here: https://github.com/sabymike/MSSimpleGauge
- * Pie Chart iOS Class here: https://github.com/honcheng/iOSPlot
- * NSObject+PerformBlockAfterDelay iOS Class here: http://www.mikeash.com/pyblog/friday-qa-2009-08-14-practical-blocks.html
+## Third-Party Plugins
-License
-===================
+A big thank you to the makers of:
-Copyright © 2009-2016 Shmoopi LLC
+* Annotated Gauge iOS Class here:
+* Pie Chart iOS Class here:
+* NSObject+PerformBlockAfterDelay iOS Class here:
-This class and its usage are very intuitive and provide as simple an interface as possible for developers to plug into. Please feel free to customize the class as much as you'd like, or use any of the code within your projects. If you do add to the project, make sure to let me know so we can merge any changes.
+## License
-If you like what you see here, or on our website, please feel free to drop us a line or purchase one of our applications!
+Copyright © 2012 Shmoopi LLC
-~Shmoopi LLC
+If you like what you see here, or on our website, please feel free to drop us a line or purchase one of our applications!
\ No newline at end of file
diff --git a/Sample Images/Screenshot1.png b/Sample Images/Screenshot1.png
index 82d5282..e49a8c2 100644
Binary files a/Sample Images/Screenshot1.png and b/Sample Images/Screenshot1.png differ
diff --git a/Sample Images/Screenshot2.png b/Sample Images/Screenshot2.png
index bffded3..0cd0308 100644
Binary files a/Sample Images/Screenshot2.png and b/Sample Images/Screenshot2.png differ
diff --git a/System Services/SystemServices.h b/System Services/SystemServices.h
index 519acdc..14537d2 100755
--- a/System Services/SystemServices.h
+++ b/System Services/SystemServices.h
@@ -21,15 +21,10 @@
#import "SSProcessorInfo.h"
#import "SSUUID.h"
-/* New Hardware Stuff, new accelerometer stuff, localization stuff, and application info */
-
@interface SystemServices : NSObject
// Shared Manager
-+ (_Nonnull id)sharedServices;
-
-// Parent ID for a certain PID
-- (int)parentPIDForProcess:(int)pid;
++ (nonnull instancetype)sharedServices;
// Properties
@@ -80,6 +75,15 @@
// Plugged In?
@property (nonatomic, readonly) BOOL pluggedIn;
+// Step-Counting Available?
+@property (nonatomic, readonly) BOOL stepCountingAvailable;
+
+// Distance Available
+@property (nonatomic, readonly) BOOL distanceAvailable;
+
+// Floor Counting Available
+@property (nonatomic, readonly) BOOL floorCountingAvailable;
+
/* Jailbreak Check */
// Jailbroken?
@@ -93,11 +97,8 @@
// Number of Active Processors
@property (nonatomic, readonly) NSInteger numberActiveProcessors;
-// Processor Speed in MHz
-@property (nonatomic, readonly) NSInteger processorSpeed;
-
-// Processor Bus Speed in MHz
-@property (nonatomic, readonly) NSInteger processorBusSpeed;
+// Processor Usage Information
+@property (nonatomic, readonly, nullable) NSArray *processorsUsage;
/* Accessory Information */
@@ -149,18 +150,12 @@
// Get Current IP Address
@property (nonatomic, readonly, nullable) NSString *currentIPAddress;
-// Get Current MAC Address
-@property (nonatomic, readonly, nullable) NSString *currentMACAddress;
-
// Get External IP Address
@property (nonatomic, readonly, nullable) NSString *externalIPAddress;
// Get Cell IP Address
@property (nonatomic, readonly, nullable) NSString *cellIPAddress;
-// Get Cell MAC Address
-@property (nonatomic, readonly, nullable) NSString *cellMACAddress;
-
// Get Cell Netmask Address
@property (nonatomic, readonly, nullable) NSString *cellNetmaskAddress;
@@ -170,9 +165,6 @@
// Get WiFi IP Address
@property (nonatomic, readonly, nullable) NSString *wiFiIPAddress;
-// Get WiFi MAC Address
-@property (nonatomic, readonly, nullable) NSString *wiFiMACAddress;
-
// Get WiFi Netmask Address
@property (nonatomic, readonly, nullable) NSString *wiFiNetmaskAddress;
@@ -193,18 +185,6 @@
// Process ID
@property (nonatomic, readonly) int processID;
-// Process Name
-@property (nonatomic, readonly, nullable) NSString *processName;
-
-// Process Status
-@property (nonatomic, readonly) int processStatus;
-
-// Parent Process ID
-@property (nonatomic, readonly) int parentPID;
-
-// List of process information including PID's, Names, PPID's, and Status'
-@property (nonatomic, readonly, nullable) NSMutableArray *processesInformation;
-
/* Disk Information */
// Total Disk Space
@@ -296,18 +276,12 @@
// Clipboard Content
@property (nonatomic, readonly, nullable) NSString *clipboardContent;
-/* Universal Unique Identifiers */
-
-// Unique ID
-@property (nonatomic, readonly, nullable) NSString *uniqueID;
+// Application CPU Usage
+@property (nonatomic, readonly) float applicationCPUUsage;
-// Device Signature
-@property (nonatomic, readonly, nullable) NSString *deviceSignature;
+/* Universal Unique Identifiers */
// CFUUID
@property (nonatomic, readonly, nullable) NSString *cfuuid;
-// CPU Usage
-@property (nonatomic, readonly) float cpuUsage;
-
@end
diff --git a/System Services/SystemServices.m b/System Services/SystemServices.m
index d1613fc..77d9922 100755
--- a/System Services/SystemServices.m
+++ b/System Services/SystemServices.m
@@ -8,298 +8,19 @@
#import "SystemServices.h"
-@interface SystemServices () {
- // Private
-
- /* All System Information in Dictionary Format */
- NSDictionary *allSystemInformation;
-
- /* Hardware Information */
-
- // System Uptime (dd hh mm)
- NSString *systemsUptime;
-
- // Model of Device
- NSString *deviceModel;
-
- // Device Name
- NSString *deviceName;
-
- // System Name
- NSString *systemName;
-
- // System Version
- NSString *systemsVersion;
-
- // System Device Type (Not Formatted = iPhone1,0)
- NSString *systemDeviceTypeNotFormatted;
-
- // System Device Type (Formatted = iPhone 1)
- NSString *systemDeviceTypeFormatted;
-
- // Get the Screen Width (X)
- NSInteger screenWidth;
-
- // Get the Screen Height (Y)
- NSInteger screenHeight;
-
- // Get the Screen Brightness
- float screenBrightness;
-
- // Multitasking enabled?
- BOOL multitaskingEnabled;
-
- // Proximity sensor enabled?
- BOOL proximitySensorEnabled;
-
- // Debugger Attached?
- BOOL debuggerAttached;
-
- // Plugged In?
- BOOL pluggedIn;
-
- /* Jailbreak Check */
-
- // Jailbroken?
- int jailbroken;
-
- /* Processor Information */
-
- // Number of processors
- NSInteger numberProcessors;
-
- // Number of Active Processors
- NSInteger numberActiveProcessors;
-
- // Processor Speed in MHz
- NSInteger processorSpeed;
-
- // Processor Bus Speed in MHz
- NSInteger processorBusSpeed;
-
- /* Accessory Information */
-
- // Are any accessories attached?
- BOOL accessoriesAttached;
-
- // Are headphone attached?
- BOOL headphonesAttached;
-
- // Number of attached accessories
- NSInteger numberAttachedAccessories;
-
- // Name of attached accessory/accessories (seperated by , comma's)
- NSString *nameAttachedAccessories;
-
- /* Carrier Information */
-
- // Carrier Name
- NSString *carrierName;
-
- // Carrier Country
- NSString *carrierCountry;
-
- // Carrier Mobile Country Code
- NSString *carrierMobileCountryCode;
-
- // Carrier ISO Country Code
- NSString *carrierISOCountryCode;
-
- // Carrier Mobile Network Code
- NSString *carrierMobileNetworkCode;
-
- // Carrier Allows VOIP
- BOOL carrierAllowsVOIP;
-
- /* Battery Information */
-
- // Battery Level
- float batteryLevel;
-
- // Charging?
- BOOL charging;
-
- // Fully Charged?
- BOOL fullyCharged;
-
- /* Network Information */
-
- // Get Current IP Address
- NSString *currentIPAddress;
-
- // Get Current MAC Address
- NSString *currentMACAddress;
-
- // Get External IP Address
- NSString *externalIPAddress;
-
- // Get Cell IP Address
- NSString *cellIPAddress;
-
- // Get Cell MAC Address
- NSString *cellMACAddress;
-
- // Get Cell Netmask Address
- NSString *cellNetmaskAddress;
-
- // Get Cell Broadcast Address
- NSString *cellBroadcastAddress;
-
- // Get WiFi IP Address
- NSString *wiFiIPAddress;
-
- // Get WiFi MAC Address
- NSString *wiFiMACAddress;
-
- // Get WiFi Netmask Address
- NSString *wiFiNetmaskAddress;
-
- // Get WiFi Broadcast Address
- NSString *wiFiBroadcastAddress;
-
- // Get WiFi Router Address
- NSString *wiFiRouterAddress;
-
- // Connected to WiFi?
- BOOL connectedToWiFi;
-
- // Connected to Cellular Network?
- BOOL connectedToCellNetwork;
-
- /* Process Information */
-
- // Process ID
- int processID;
-
- // Process Name
- NSString *processName;
-
- // Process Status
- int processStatus;
-
- // Parent Process ID
- int parentPID;
-
- // List of process information including PID's, Names, PPID's, and Status'
- NSMutableArray *processesInformation;
-
- /* Disk Information */
-
- // Total Disk Space
- NSString *diskSpace;
-
- // Total Free Disk Space (Raw)
- NSString *freeDiskSpaceinRaw;
-
- // Total Free Disk Space (Percentage)
- NSString *freeDiskSpaceinPercent;
-
- // Total Used Disk Space (Raw)
- NSString *usedDiskSpaceinRaw;
-
- // Total Used Disk Space (Percentage)
- NSString *usedDiskSpaceinPercent;
-
- // Get the total disk space in long format
- long long longDiskSpace;
-
- // Get the total free disk space in long format
- long long longFreeDiskSpace;
-
- /* Memory Information */
-
- // Total Memory
- double totalMemory;
-
- // Free Memory (Raw)
- double freeMemoryinRaw;
-
- // Free Memory (Percent)
- double freeMemoryinPercent;
-
- // Used Memory (Raw)
- double usedMemoryinRaw;
-
- // Used Memory (Percent)
- double usedMemoryinPercent;
-
- // Active Memory (Raw)
- double activeMemoryinRaw;
-
- // Active Memory (Percent)
- double activeMemoryinPercent;
-
- // Inactive Memory (Raw)
- double inactiveMemoryinRaw;
-
- // Inactive Memory (Percent)
- double inactiveMemoryinPercent;
-
- // Wired Memory (Raw)
- double wiredMemoryinRaw;
-
- // Wired Memory (Percent)
- double wiredMemoryinPercent;
-
- // Purgable Memory (Raw)
- double purgableMemoryinRaw;
-
- // Purgable Memory (Percent)
- double purgableMemoryinPercent;
-
- /* Accelerometer Information */
-
- // Device Orientation
- UIInterfaceOrientation deviceOrientation;
-
- /* Localization Information */
-
- // Country
- NSString *country;
-
- // Language
- NSString *language;
-
- // TimeZone
- NSString *timeZoneSS;
-
- // Currency Symbol
- NSString *currency;
-
- /* Application Information */
-
- // Application Version
- NSString *applicationVersion;
-
- // Clipboard Content
- NSString *clipboardContent;
-
- /* Universal Unique Identifiers */
-
- // Unique ID
- NSString *uniqueID;
-
- // Device Signature
- NSString *deviceSignature;
-
- // CFUUID
- NSString *cfuuid;
-
- // CPU Usage
- float cpuUsage;
-}
+@interface SystemServices ()
// Get all System Information (All Methods)
-- (NSDictionary *)getAllSystemInformation;
+- (nullable NSDictionary *)getAllSystemInformation;
@end
@implementation SystemServices
-@dynamic allSystemInformation, systemsUptime, deviceModel, deviceName, systemName, systemsVersion, systemDeviceTypeNotFormatted, systemDeviceTypeFormatted, screenWidth, screenHeight, screenBrightness, multitaskingEnabled, proximitySensorEnabled, debuggerAttached, pluggedIn, jailbroken, numberProcessors, numberActiveProcessors, processorSpeed, processorBusSpeed, accessoriesAttached, headphonesAttached, numberAttachedAccessories, nameAttachedAccessories, carrierName, carrierCountry, carrierMobileCountryCode, carrierISOCountryCode, carrierMobileNetworkCode, carrierAllowsVOIP, batteryLevel, charging, fullyCharged, currentIPAddress, currentMACAddress, externalIPAddress, cellIPAddress, cellMACAddress, cellNetmaskAddress, cellBroadcastAddress, wiFiIPAddress, wiFiMACAddress, wiFiNetmaskAddress, wiFiBroadcastAddress, wiFiRouterAddress, connectedToWiFi, connectedToCellNetwork, processID, processName, processStatus, parentPID, processesInformation, diskSpace, freeDiskSpaceinRaw, freeDiskSpaceinPercent, usedDiskSpaceinRaw, usedDiskSpaceinPercent, longDiskSpace, longFreeDiskSpace, totalMemory, freeMemoryinRaw, freeMemoryinPercent, usedMemoryinRaw, usedMemoryinPercent, activeMemoryinRaw, activeMemoryinPercent, inactiveMemoryinRaw, inactiveMemoryinPercent, wiredMemoryinRaw, wiredMemoryinPercent, purgableMemoryinRaw, purgableMemoryinPercent, deviceOrientation, country, language, timeZoneSS, currency, applicationVersion, clipboardContent, uniqueID, deviceSignature, cfuuid, cpuUsage;
+@dynamic allSystemInformation, systemsUptime, deviceModel, deviceName, systemName, systemsVersion, systemDeviceTypeNotFormatted, systemDeviceTypeFormatted, screenWidth, screenHeight, screenBrightness, multitaskingEnabled, proximitySensorEnabled, debuggerAttached, pluggedIn, jailbroken, numberProcessors, numberActiveProcessors, processorsUsage, accessoriesAttached, headphonesAttached, numberAttachedAccessories, nameAttachedAccessories, carrierName, carrierCountry, carrierMobileCountryCode, carrierISOCountryCode, carrierMobileNetworkCode, carrierAllowsVOIP, batteryLevel, charging, fullyCharged, currentIPAddress, externalIPAddress, cellIPAddress, cellNetmaskAddress, cellBroadcastAddress, wiFiIPAddress, wiFiNetmaskAddress, wiFiBroadcastAddress, wiFiRouterAddress, connectedToWiFi, connectedToCellNetwork, processID, diskSpace, freeDiskSpaceinRaw, freeDiskSpaceinPercent, usedDiskSpaceinRaw, usedDiskSpaceinPercent, longDiskSpace, longFreeDiskSpace, totalMemory, freeMemoryinRaw, freeMemoryinPercent, usedMemoryinRaw, usedMemoryinPercent, activeMemoryinRaw, activeMemoryinPercent, inactiveMemoryinRaw, inactiveMemoryinPercent, wiredMemoryinRaw, wiredMemoryinPercent, purgableMemoryinRaw, purgableMemoryinPercent, deviceOrientation, country, language, timeZoneSS, currency, applicationVersion, clipboardContent, cfuuid, applicationCPUUsage, stepCountingAvailable, distanceAvailable, floorCountingAvailable;
// Singleton
-+ (id)sharedServices {
++ (nonnull instancetype)sharedServices {
static SystemServices *sharedSystemServices = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
@@ -308,16 +29,6 @@ + (id)sharedServices {
return sharedSystemServices;
}
-// Init
-- (id)init {
- if (self = [super init]) {
- // Initialize variables
- //[self refreshValues];
- }
-
- return self;
-}
-
// System Information
- (NSString *)systemsUptime {
@@ -376,6 +87,18 @@ - (BOOL)pluggedIn {
return [SSHardwareInfo pluggedIn];
}
+- (BOOL)stepCountingAvailable {
+ return [SSHardwareInfo stepCountingAvailable];
+}
+
+- (BOOL)distanceAvailable {
+ return [SSHardwareInfo distanceAvailable];
+}
+
+- (BOOL)floorCountingAvailable {
+ return [SSHardwareInfo floorCountingAvailable];
+}
+
- (int)jailbroken {
return [SSJailbreakCheck jailbroken];
}
@@ -388,12 +111,8 @@ - (NSInteger)numberActiveProcessors {
return [SSProcessorInfo numberActiveProcessors];
}
-- (NSInteger)processorSpeed {
- return [SSProcessorInfo processorSpeed];
-}
-
-- (NSInteger)processorBusSpeed {
- return [SSProcessorInfo processorBusSpeed];
+- (nullable NSArray *)processorsUsage {
+ return [SSProcessorInfo processorsUsage];
}
- (BOOL)accessoriesAttached {
@@ -452,10 +171,6 @@ - (nullable NSString *)currentIPAddress {
return [SSNetworkInfo currentIPAddress];
}
-- (nullable NSString *)currentMACAddress{
- return [SSNetworkInfo currentMACAddress];
-}
-
- (nullable NSString *)externalIPAddress {
return [SSNetworkInfo externalIPAddress];
}
@@ -464,10 +179,6 @@ - (nullable NSString *)cellIPAddress {
return [SSNetworkInfo cellIPAddress];
}
-- (nullable NSString *)cellMACAddress {
- return [SSNetworkInfo cellMACAddress];
-}
-
- (nullable NSString *)cellNetmaskAddress {
return [SSNetworkInfo cellNetmaskAddress];
}
@@ -480,10 +191,6 @@ - (nullable NSString *)wiFiIPAddress {
return [SSNetworkInfo wiFiIPAddress];
}
-- (nullable NSString *)wiFiMACAddress {
- return [SSNetworkInfo wiFiMACAddress];
-}
-
- (nullable NSString *)wiFiNetmaskAddress {
return [SSNetworkInfo wiFiNetmaskAddress];
}
@@ -508,22 +215,6 @@ - (int)processID {
return [SSProcessInfo processID];
}
-- (NSString *)processName {
- return [SSProcessInfo processName];
-}
-
-- (int)processStatus {
- return [SSProcessInfo processStatus];
-}
-
-- (int)parentPID {
- return [SSProcessInfo parentPID];
-}
-
-- (NSMutableArray *)processesInformation {
- return [SSProcessInfo processesInformation];
-}
-
- (NSString *)diskSpace {
return [SSDiskInfo diskSpace];
}
@@ -632,19 +323,11 @@ - (NSString *)clipboardContent {
return [SSApplicationInfo clipboardContent];
}
-- (NSString *)uniqueID {
- return [SSUUID uniqueID];
-}
-
-- (NSString *)deviceSignature {
- return [SSUUID deviceSignature];
-}
-
- (NSString *)cfuuid {
return [SSUUID cfuuid];
}
-- (float)cpuUsage {
+- (float)applicationCPUUsage {
return [SSApplicationInfo cpuUsage];
}
@@ -652,509 +335,464 @@ - (NSDictionary *)allSystemInformation {
return [self getAllSystemInformation];
}
+// Private //
+
// Get all System Information (All Methods)
- (NSDictionary *)getAllSystemInformation {
- // Create an array
- NSDictionary *SystemInformationDict;
+
+ // Create a dictionary
+ NSDictionary *systemInformationDict;
// Set up all System Values
- NSString *SystemUptime = [self systemsUptime];
- NSString *DeviceModel = [self deviceModel];
- NSString *DeviceName = [self deviceName];
- NSString *SystemName = [self systemName];
- NSString *SystemVersion = [self systemsVersion];
- NSString *SystemDeviceTypeFormattedNO = [self systemDeviceTypeNotFormatted];
- NSString *SystemDeviceTypeFormattedYES = [self systemDeviceTypeFormatted];
- NSString *ScreenWidth = [NSString stringWithFormat:@"%ld", (long)[self screenWidth]];
- NSString *ScreenHeight = [NSString stringWithFormat:@"%ld", (long)[self screenHeight]];
- NSString *ScreenBrightness = [NSString stringWithFormat:@"%f", [self screenBrightness]];
- NSString *MultitaskingEnabled = ([self multitaskingEnabled]) ? @"Yes" : @"No";
- NSString *ProximitySensorEnabled = ([self proximitySensorEnabled]) ? @"Yes" : @"No";
- NSString *DebuggerAttached = ([self debuggerAttached]) ? @"Yes" : @"No";
- NSString *PluggedIn = ([self pluggedIn]) ? @"Yes" : @"No";
- NSString *Jailbroken = [NSString stringWithFormat:@"%d", [self jailbroken]];
- NSString *NumberProcessors = [NSString stringWithFormat:@"%ld", (long)[self numberProcessors]];
- NSString *NumberActiveProcessors = [NSString stringWithFormat:@"%ld", (long)[self numberActiveProcessors]];
- NSString *ProcessorSpeed = [NSString stringWithFormat:@"%ld", (long)[self processorSpeed]];
- NSString *ProcessorBusSpeed = [NSString stringWithFormat:@"%ld", (long)[self processorBusSpeed]];
- NSString *AccessoriesAttached = ([self accessoriesAttached]) ? @"Yes" : @"No";
- NSString *HeadphonesAttached = ([self headphonesAttached]) ? @"Yes" : @"No";
- NSString *NumberAttachedAccessories = [NSString stringWithFormat:@"%ld", (long)[self numberAttachedAccessories]];
- NSString *NameAttachedAccessories = [self nameAttachedAccessories];
- NSString *CarrierName = [self carrierName];
- NSString *CarrierCountry = [self carrierCountry];
- NSString *CarrierMobileCountryCode = [self carrierMobileCountryCode];
- NSString *CarrierISOCountryCode = [self carrierISOCountryCode];
- NSString *CarrierMobileNetworkCode = [self carrierMobileNetworkCode];
- NSString *CarrierAllowsVOIP = ([self carrierAllowsVOIP]) ? @"Yes" : @"No";
- NSString *BatteryLevel = [NSString stringWithFormat:@"%f", [self batteryLevel]];
- NSString *Charging = ([self charging]) ? @"Yes" : @"No";
- NSString *FullyCharged = ([self fullyCharged]) ? @"Yes" : @"No";
- NSString *CurrentIPAddress = [self currentIPAddress];
- NSString *CurrentMACAddress = [self currentMACAddress];
- NSString *ExternalIPAddress = [self externalIPAddress];
- NSString *CellIPAddress = [self cellIPAddress];
- NSString *CellMACAddress = [self cellMACAddress];
- NSString *CellNetmaskAddress = [self cellNetmaskAddress];
- NSString *CellBroadcastAddress = [self cellBroadcastAddress];
- NSString *WiFiIPAddress = [self wiFiIPAddress];
- NSString *WiFiMACAddress = [self wiFiMACAddress];
- NSString *WiFiNetmaskAddress = [self wiFiNetmaskAddress];
- NSString *WiFiBroadcastAddress = [self wiFiBroadcastAddress];
- NSString *WiFiRouterAddress = [self wiFiRouterAddress];
- NSString *ConnectedToWiFi = ([self connectedToWiFi]) ? @"Yes" : @"No";
- NSString *ConnectedToCellNetwork = ([self connectedToCellNetwork]) ? @"Yes" : @"No";
- NSString *ProcessID = [NSString stringWithFormat:@"%d", [self processID]];
- NSString *ProcessName = [self processName];
- NSString *ProcessStatus = [NSString stringWithFormat:@"%d", [self processStatus]];
- NSString *ParentPID = [NSString stringWithFormat:@"%d", [self parentPID]];
- NSMutableArray *ProcessesInformation = [self processesInformation];
- NSString *DiskSpace = [self diskSpace];
- NSString *FreeDiskSpaceNO = [self freeDiskSpaceinRaw];
- NSString *FreeDiskSpaceYES = [self freeDiskSpaceinPercent];
- NSString *UsedDiskSpaceNO = [self usedDiskSpaceinRaw];
- NSString *UsedDiskSpaceYES = [self usedDiskSpaceinPercent];
- NSString *LongDiskSpace = [NSString stringWithFormat:@"%lld", [self longDiskSpace]];
- NSString *LongFreeDiskSpace = [NSString stringWithFormat:@"%lld", [self longFreeDiskSpace]];
- NSString *TotalMemory = [NSString stringWithFormat:@"%f", [self totalMemory]];
- NSString *FreeMemoryNO = [NSString stringWithFormat:@"%f", [self freeMemoryinRaw]];
- NSString *FreeMemoryYES = [NSString stringWithFormat:@"%f", [self freeMemoryinPercent]];
- NSString *UsedMemoryNO = [NSString stringWithFormat:@"%f", [self usedMemoryinRaw]];
- NSString *UsedMemoryYES = [NSString stringWithFormat:@"%f", [self usedMemoryinPercent]];
- NSString *ActiveMemoryNO = [NSString stringWithFormat:@"%f", [self activeMemoryinRaw]];
- NSString *ActiveMemoryYES = [NSString stringWithFormat:@"%f", [self activeMemoryinPercent]];
- NSString *InactiveMemoryNO = [NSString stringWithFormat:@"%f", [self inactiveMemoryinRaw]];
- NSString *InactiveMemoryYES = [NSString stringWithFormat:@"%f", [self inactiveMemoryinPercent]];
- NSString *WiredMemoryNO = [NSString stringWithFormat:@"%f", [self wiredMemoryinRaw]];
- NSString *WiredMemoryYES = [NSString stringWithFormat:@"%f", [self wiredMemoryinPercent]];
- NSString *PurgableMemoryNO = [NSString stringWithFormat:@"%f", [self purgableMemoryinRaw]];
- NSString *PurgableMemoryYES = [NSString stringWithFormat:@"%f", [self purgableMemoryinPercent]];
- NSString *DeviceOrientation = [NSString stringWithFormat:@"%ld", [self deviceOrientation]];
- NSString *Country = [self country];
- NSString *Language = [self language];
- NSString *TimeZone = [self timeZoneSS];
- NSString *Currency = [self currency];
- NSString *ApplicationVersion = [self applicationVersion];
- NSString *ClipboardContent = [self clipboardContent];
- NSString *UniqueID = [self uniqueID];
- NSString *DeviceSignature = [self deviceSignature];
- NSString *CFUUID = [self cfuuid];
- NSString *CPUUsage = [NSString stringWithFormat:@"%f", [self cpuUsage]];
+ NSString *systemUptime = [self systemsUptime];
+ NSString *deviceModel = [self deviceModel];
+ NSString *deviceName = [self deviceName];
+ NSString *systemName = [self systemName];
+ NSString *systemVersion = [self systemsVersion];
+ NSString *systemDeviceTypeFormattedNO = [self systemDeviceTypeNotFormatted];
+ NSString *systemDeviceTypeFormattedYES = [self systemDeviceTypeFormatted];
+ NSString *screenWidth = [NSString stringWithFormat:@"%ld", (long)[self screenWidth]];
+ NSString *screenHeight = [NSString stringWithFormat:@"%ld", (long)[self screenHeight]];
+ NSString *screenBrightness = [NSString stringWithFormat:@"%f", [self screenBrightness]];
+ NSString *multitaskingEnabled = ([self multitaskingEnabled]) ? @"Yes" : @"No";
+ NSString *proximitySensorEnabled = ([self proximitySensorEnabled]) ? @"Yes" : @"No";
+ NSString *debuggerAttached = ([self debuggerAttached]) ? @"Yes" : @"No";
+ NSString *pluggedIn = ([self pluggedIn]) ? @"Yes" : @"No";
+ NSString *stepCountingAvailable = ([self stepCountingAvailable]) ? @"Yes" : @"No";
+ NSString *distanceAvailable = ([self distanceAvailable]) ? @"Yes" : @"No";
+ NSString *floorCountingAvailable = ([self floorCountingAvailable]) ? @"Yes" : @"No";
+ NSString *jailbroken = [NSString stringWithFormat:@"%d", [self jailbroken]];
+ NSString *numberProcessors = [NSString stringWithFormat:@"%ld", (long)[self numberProcessors]];
+ NSString *numberActiveProcessors = [NSString stringWithFormat:@"%ld", (long)[self numberActiveProcessors]];
+ NSString *processorsUsage = [NSString stringWithFormat:@"%@", [self processorsUsage]];
+ NSString *accessoriesAttached = ([self accessoriesAttached]) ? @"Yes" : @"No";
+ NSString *headphonesAttached = ([self headphonesAttached]) ? @"Yes" : @"No";
+ NSString *numberAttachedAccessories = [NSString stringWithFormat:@"%ld", (long)[self numberAttachedAccessories]];
+ NSString *nameAttachedAccessories = [self nameAttachedAccessories];
+ NSString *carrierName = [self carrierName];
+ NSString *carrierCountry = [self carrierCountry];
+ NSString *carrierMobileCountryCode = [self carrierMobileCountryCode];
+ NSString *carrierISOCountryCode = [self carrierISOCountryCode];
+ NSString *carrierMobileNetworkCode = [self carrierMobileNetworkCode];
+ NSString *carrierAllowsVOIP = ([self carrierAllowsVOIP]) ? @"Yes" : @"No";
+ NSString *batteryLevel = [NSString stringWithFormat:@"%f", [self batteryLevel]];
+ NSString *charging = ([self charging]) ? @"Yes" : @"No";
+ NSString *fullyCharged = ([self fullyCharged]) ? @"Yes" : @"No";
+ NSString *currentIPAddress = [self currentIPAddress];
+ NSString *externalIPAddress = [self externalIPAddress];
+ NSString *cellIPAddress = [self cellIPAddress];
+ NSString *cellNetmaskAddress = [self cellNetmaskAddress];
+ NSString *cellBroadcastAddress = [self cellBroadcastAddress];
+ NSString *wiFiIPAddress = [self wiFiIPAddress];
+ NSString *wiFiNetmaskAddress = [self wiFiNetmaskAddress];
+ NSString *wiFiBroadcastAddress = [self wiFiBroadcastAddress];
+ NSString *wiFiRouterAddress = [self wiFiRouterAddress];
+ NSString *connectedToWiFi = ([self connectedToWiFi]) ? @"Yes" : @"No";
+ NSString *connectedToCellNetwork = ([self connectedToCellNetwork]) ? @"Yes" : @"No";
+ NSString *processID = [NSString stringWithFormat:@"%d", [self processID]];
+ NSString *diskSpace = [self diskSpace];
+ NSString *freeDiskSpaceNO = [self freeDiskSpaceinRaw];
+ NSString *freeDiskSpaceYES = [self freeDiskSpaceinPercent];
+ NSString *usedDiskSpaceNO = [self usedDiskSpaceinRaw];
+ NSString *usedDiskSpaceYES = [self usedDiskSpaceinPercent];
+ NSString *longDiskSpace = [NSString stringWithFormat:@"%lld", [self longDiskSpace]];
+ NSString *longFreeDiskSpace = [NSString stringWithFormat:@"%lld", [self longFreeDiskSpace]];
+ NSString *totalMemory = [NSString stringWithFormat:@"%f", [self totalMemory]];
+ NSString *freeMemoryNO = [NSString stringWithFormat:@"%f", [self freeMemoryinRaw]];
+ NSString *freeMemoryYES = [NSString stringWithFormat:@"%f", [self freeMemoryinPercent]];
+ NSString *usedMemoryNO = [NSString stringWithFormat:@"%f", [self usedMemoryinRaw]];
+ NSString *usedMemoryYES = [NSString stringWithFormat:@"%f", [self usedMemoryinPercent]];
+ NSString *activeMemoryNO = [NSString stringWithFormat:@"%f", [self activeMemoryinRaw]];
+ NSString *activeMemoryYES = [NSString stringWithFormat:@"%f", [self activeMemoryinPercent]];
+ NSString *inactiveMemoryNO = [NSString stringWithFormat:@"%f", [self inactiveMemoryinRaw]];
+ NSString *inactiveMemoryYES = [NSString stringWithFormat:@"%f", [self inactiveMemoryinPercent]];
+ NSString *wiredMemoryNO = [NSString stringWithFormat:@"%f", [self wiredMemoryinRaw]];
+ NSString *wiredMemoryYES = [NSString stringWithFormat:@"%f", [self wiredMemoryinPercent]];
+ NSString *purgableMemoryNO = [NSString stringWithFormat:@"%f", [self purgableMemoryinRaw]];
+ NSString *purgableMemoryYES = [NSString stringWithFormat:@"%f", [self purgableMemoryinPercent]];
+ NSString *deviceOrientation = [NSString stringWithFormat:@"%ld", (long)[self deviceOrientation]];
+ NSString *country = [self country];
+ NSString *language = [self language];
+ NSString *timeZone = [self timeZoneSS];
+ NSString *currency = [self currency];
+ NSString *applicationVersion = [self applicationVersion];
+ NSString *cFUUID = [self cfuuid];
+ NSString *cPUUsage = [NSString stringWithFormat:@"%f", [self applicationCPUUsage]];
// Check to make sure all values are valid (if not, make them)
- if (SystemUptime == nil || SystemUptime.length <= 0) {
- // Invalid value
- SystemUptime = @"Unknown";
- }
- if (DeviceModel == nil || DeviceModel.length <= 0) {
+ if (systemUptime == nil || systemUptime.length <= 0) {
// Invalid value
- DeviceModel = @"Unknown";
+ systemUptime = @"Unknown";
}
- if (DeviceName == nil || DeviceName.length <= 0) {
+ if (deviceModel == nil || deviceModel.length <= 0) {
// Invalid value
- DeviceName = @"Unknown";
+ deviceModel = @"Unknown";
}
- if (SystemName == nil || SystemName.length <= 0) {
+ if (deviceName == nil || deviceName.length <= 0) {
// Invalid value
- SystemName = @"Unknown";
+ deviceName = @"Unknown";
}
- if (SystemVersion == nil || SystemVersion.length <= 0) {
+ if (systemName == nil || systemName.length <= 0) {
// Invalid value
- SystemVersion = @"Unknown";
+ systemName = @"Unknown";
}
- if (SystemDeviceTypeFormattedNO == nil || SystemDeviceTypeFormattedNO.length <= 0) {
+ if (systemVersion == nil || systemVersion.length <= 0) {
// Invalid value
- SystemDeviceTypeFormattedNO = @"Unknown";
+ systemVersion = @"Unknown";
}
- if (SystemDeviceTypeFormattedYES == nil || SystemDeviceTypeFormattedYES.length <= 0) {
+ if (systemDeviceTypeFormattedNO == nil || systemDeviceTypeFormattedNO.length <= 0) {
// Invalid value
- SystemDeviceTypeFormattedYES = @"Unknown";
+ systemDeviceTypeFormattedNO = @"Unknown";
}
- if (ScreenWidth == nil || ScreenWidth.length <= 0) {
+ if (systemDeviceTypeFormattedYES == nil || systemDeviceTypeFormattedYES.length <= 0) {
// Invalid value
- ScreenWidth = @"Unknown";
+ systemDeviceTypeFormattedYES = @"Unknown";
}
- if (ScreenHeight == nil || ScreenHeight.length <= 0) {
+ if (screenWidth == nil || screenWidth.length <= 0) {
// Invalid value
- ScreenHeight = @"Unknown";
+ screenWidth = @"Unknown";
}
- if (ScreenBrightness == nil || ScreenBrightness.length <= 0) {
+ if (screenHeight == nil || screenHeight.length <= 0) {
// Invalid value
- ScreenBrightness = @"Unknown";
+ screenHeight = @"Unknown";
}
- if (MultitaskingEnabled == nil || MultitaskingEnabled.length <= 0) {
+ if (screenBrightness == nil || screenBrightness.length <= 0) {
// Invalid value
- MultitaskingEnabled = @"Unknown";
+ screenBrightness = @"Unknown";
}
- if (ProximitySensorEnabled == nil || ProximitySensorEnabled.length <= 0) {
+ if (multitaskingEnabled == nil || multitaskingEnabled.length <= 0) {
// Invalid value
- ProximitySensorEnabled = @"Unknown";
+ multitaskingEnabled = @"Unknown";
}
- if (DebuggerAttached == nil || DebuggerAttached.length <= 0) {
+ if (proximitySensorEnabled == nil || proximitySensorEnabled.length <= 0) {
// Invalid value
- DebuggerAttached = @"Unknown";
+ proximitySensorEnabled = @"Unknown";
}
- if (PluggedIn == nil || PluggedIn.length <= 0) {
+ if (debuggerAttached == nil || debuggerAttached.length <= 0) {
// Invalid value
- PluggedIn = @"Unknown";
+ debuggerAttached = @"Unknown";
}
- if (Jailbroken == nil || Jailbroken.length <= 0) {
+ if (pluggedIn == nil || pluggedIn.length <= 0) {
// Invalid value
- Jailbroken = @"Unknown";
+ pluggedIn = @"Unknown";
}
- if (NumberProcessors == nil || NumberProcessors.length <= 0) {
+ if (stepCountingAvailable == nil || stepCountingAvailable.length <= 0) {
// Invalid value
- NumberProcessors = @"Unknown";
+ stepCountingAvailable = @"Unknown";
}
- if (NumberActiveProcessors == nil || NumberActiveProcessors.length <= 0) {
+ if (distanceAvailable == nil || distanceAvailable.length <= 0) {
// Invalid value
- NumberActiveProcessors = @"Unknown";
+ distanceAvailable = @"Unknown";
}
- if (ProcessorSpeed == nil || ProcessorSpeed.length <= 0) {
+ if (floorCountingAvailable == nil || floorCountingAvailable.length <= 0) {
// Invalid value
- ProcessorSpeed = @"Unknown";
+ floorCountingAvailable = @"Unknown";
}
- if (ProcessorBusSpeed == nil || ProcessorBusSpeed.length <= 0) {
+ if (jailbroken == nil || jailbroken.length <= 0) {
// Invalid value
- ProcessorBusSpeed = @"Unknown";
+ jailbroken = @"Unknown";
}
- if (AccessoriesAttached == nil || AccessoriesAttached.length <= 0) {
+ if (numberProcessors == nil || numberProcessors.length <= 0) {
// Invalid value
- AccessoriesAttached = @"Unknown";
+ numberProcessors = @"Unknown";
}
- if (HeadphonesAttached == nil || HeadphonesAttached.length <= 0) {
+ if (numberActiveProcessors == nil || numberActiveProcessors.length <= 0) {
// Invalid value
- HeadphonesAttached = @"Unknown";
+ numberActiveProcessors = @"Unknown";
}
- if (NumberAttachedAccessories == nil || NumberAttachedAccessories.length <= 0) {
+ if (processorsUsage == nil || processorsUsage.length <= 0) {
// Invalid value
- NumberAttachedAccessories = @"Unknown";
+ processorsUsage = @"Unknown";
}
- if (NameAttachedAccessories == nil || NameAttachedAccessories.length <= 0) {
+ if (accessoriesAttached == nil || accessoriesAttached.length <= 0) {
// Invalid value
- NameAttachedAccessories = @"Unknown";
+ accessoriesAttached = @"Unknown";
}
- if (CarrierName == nil || CarrierName.length <= 0) {
+ if (headphonesAttached == nil || headphonesAttached.length <= 0) {
// Invalid value
- CarrierName = @"Unknown";
+ headphonesAttached = @"Unknown";
}
- if (CarrierCountry == nil || CarrierCountry.length <= 0) {
+ if (numberAttachedAccessories == nil || numberAttachedAccessories.length <= 0) {
// Invalid value
- CarrierCountry = @"Unknown";
+ numberAttachedAccessories = @"Unknown";
}
- if (CarrierMobileCountryCode == nil || CarrierMobileCountryCode.length <= 0) {
+ if (nameAttachedAccessories == nil || nameAttachedAccessories.length <= 0) {
// Invalid value
- CarrierMobileCountryCode = @"Unknown";
+ nameAttachedAccessories = @"Unknown";
}
- if (CarrierISOCountryCode == nil || CarrierISOCountryCode.length <= 0) {
+ if (carrierName == nil || carrierName.length <= 0) {
// Invalid value
- CarrierISOCountryCode = @"Unknown";
+ carrierName = @"Unknown";
}
- if (CarrierMobileNetworkCode == nil || CarrierMobileNetworkCode.length <= 0) {
+ if (carrierCountry == nil || carrierCountry.length <= 0) {
// Invalid value
- CarrierMobileNetworkCode = @"Unknown";
+ carrierCountry = @"Unknown";
}
- if (CarrierAllowsVOIP == nil || CarrierAllowsVOIP.length <= 0) {
+ if (carrierMobileCountryCode == nil || carrierMobileCountryCode.length <= 0) {
// Invalid value
- CarrierAllowsVOIP = @"Unknown";
+ carrierMobileCountryCode = @"Unknown";
}
- if (BatteryLevel == nil || BatteryLevel.length <= 0) {
+ if (carrierISOCountryCode == nil || carrierISOCountryCode.length <= 0) {
// Invalid value
- BatteryLevel = @"Unknown";
+ carrierISOCountryCode = @"Unknown";
}
- if (Charging == nil || Charging.length <= 0) {
+ if (carrierMobileNetworkCode == nil || carrierMobileNetworkCode.length <= 0) {
// Invalid value
- Charging = @"Unknown";
+ carrierMobileNetworkCode = @"Unknown";
}
- if (FullyCharged == nil || FullyCharged.length <= 0) {
+ if (carrierAllowsVOIP == nil || carrierAllowsVOIP.length <= 0) {
// Invalid value
- FullyCharged = @"Unknown";
+ carrierAllowsVOIP = @"Unknown";
}
- if (CurrentIPAddress == nil || CurrentIPAddress.length <= 0) {
+ if (batteryLevel == nil || batteryLevel.length <= 0) {
// Invalid value
- CurrentIPAddress = @"Unknown";
+ batteryLevel = @"Unknown";
}
- if (CurrentMACAddress == nil || CurrentMACAddress.length <= 0) {
+ if (charging == nil || charging.length <= 0) {
// Invalid value
- CurrentMACAddress = @"Unknown";
+ charging = @"Unknown";
}
- if (ExternalIPAddress == nil || ExternalIPAddress.length <= 0) {
+ if (fullyCharged == nil || fullyCharged.length <= 0) {
// Invalid value
- ExternalIPAddress = @"Unknown";
+ fullyCharged = @"Unknown";
}
- if (CellIPAddress == nil || CellIPAddress.length <= 0) {
+ if (currentIPAddress == nil || currentIPAddress.length <= 0) {
// Invalid value
- CellIPAddress = @"Unknown";
+ currentIPAddress = @"Unknown";
}
- if (CellMACAddress == nil || CellMACAddress.length <= 0) {
+ if (externalIPAddress == nil || externalIPAddress.length <= 0) {
// Invalid value
- CellMACAddress = @"Unknown";
+ externalIPAddress = @"Unknown";
}
- if (CellNetmaskAddress == nil || CellNetmaskAddress.length <= 0) {
+ if (cellIPAddress == nil || cellIPAddress.length <= 0) {
// Invalid value
- CellNetmaskAddress = @"Unknown";
+ cellIPAddress = @"Unknown";
}
- if (CellBroadcastAddress == nil || CellBroadcastAddress.length <= 0) {
+ if (cellNetmaskAddress == nil || cellNetmaskAddress.length <= 0) {
// Invalid value
- CellBroadcastAddress = @"Unknown";
+ cellNetmaskAddress = @"Unknown";
}
- if (WiFiIPAddress == nil || WiFiIPAddress.length <= 0) {
+ if (cellBroadcastAddress == nil || cellBroadcastAddress.length <= 0) {
// Invalid value
- WiFiIPAddress = @"Unknown";
+ cellBroadcastAddress = @"Unknown";
}
- if (WiFiMACAddress == nil || WiFiMACAddress.length <= 0) {
+ if (wiFiIPAddress == nil || wiFiIPAddress.length <= 0) {
// Invalid value
- WiFiMACAddress = @"Unknown";
+ wiFiIPAddress = @"Unknown";
}
- if (WiFiNetmaskAddress == nil || WiFiNetmaskAddress.length <= 0) {
+ if (wiFiNetmaskAddress == nil || wiFiNetmaskAddress.length <= 0) {
// Invalid value
- WiFiNetmaskAddress = @"Unknown";
+ wiFiNetmaskAddress = @"Unknown";
}
- if (WiFiBroadcastAddress == nil || WiFiBroadcastAddress.length <= 0) {
+ if (wiFiBroadcastAddress == nil || wiFiBroadcastAddress.length <= 0) {
// Invalid value
- WiFiBroadcastAddress = @"Unknown";
+ wiFiBroadcastAddress = @"Unknown";
}
- if (WiFiRouterAddress == nil || WiFiRouterAddress.length <= 0) {
+ if (wiFiRouterAddress == nil || wiFiRouterAddress.length <= 0) {
// Invalid value
- WiFiRouterAddress = @"Unknown";
+ wiFiRouterAddress = @"Unknown";
}
- if (ConnectedToWiFi == nil || ConnectedToWiFi.length <= 0) {
+ if (connectedToWiFi == nil || connectedToWiFi.length <= 0) {
// Invalid value
- ConnectedToWiFi = @"Unknown";
+ connectedToWiFi = @"Unknown";
}
- if (ConnectedToCellNetwork == nil || ConnectedToCellNetwork.length <= 0) {
+ if (connectedToCellNetwork == nil || connectedToCellNetwork.length <= 0) {
// Invalid value
- ConnectedToCellNetwork = @"Unknown";
+ connectedToCellNetwork = @"Unknown";
}
- if (ProcessID == nil || ProcessID.length <= 0) {
+ if (processID == nil || processID.length <= 0) {
// Invalid value
- ProcessID = @"Unknown";
+ processID = @"Unknown";
}
- if (ProcessName == nil || ProcessName.length <= 0) {
+ if (diskSpace == nil || diskSpace.length <= 0) {
// Invalid value
- ProcessName = @"Unknown";
+ diskSpace = @"Unknown";
}
- if (ProcessStatus == nil || ProcessStatus.length <= 0) {
+ if (freeDiskSpaceNO == nil || freeDiskSpaceNO.length <= 0) {
// Invalid value
- ProcessStatus = @"Unknown";
+ freeDiskSpaceNO = @"Unknown";
}
- if (ParentPID == nil || ParentPID.length <= 0) {
+ if (freeDiskSpaceYES == nil || freeDiskSpaceYES.length <= 0) {
// Invalid value
- ParentPID = @"Unknown";
+ freeDiskSpaceYES = @"Unknown";
}
- if (ProcessesInformation == nil || ProcessesInformation.count <= 0) {
+ if (usedDiskSpaceNO == nil || usedDiskSpaceNO.length <= 0) {
// Invalid value
- ProcessesInformation = [NSMutableArray arrayWithObject:@"Unknown"];
+ usedDiskSpaceNO = @"Unknown";
}
- if (DiskSpace == nil || DiskSpace.length <= 0) {
+ if (usedDiskSpaceYES == nil || usedDiskSpaceYES.length <= 0) {
// Invalid value
- DiskSpace = @"Unknown";
+ usedDiskSpaceYES = @"Unknown";
}
- if (FreeDiskSpaceNO == nil || FreeDiskSpaceNO.length <= 0) {
+ if (longDiskSpace == nil || longDiskSpace.length <= 0) {
// Invalid value
- FreeDiskSpaceNO = @"Unknown";
+ longDiskSpace = @"Unknown";
}
- if (FreeDiskSpaceYES == nil || FreeDiskSpaceYES.length <= 0) {
+ if (longFreeDiskSpace == nil || longFreeDiskSpace.length <= 0) {
// Invalid value
- FreeDiskSpaceYES = @"Unknown";
+ longFreeDiskSpace = @"Unknown";
}
- if (UsedDiskSpaceNO == nil || UsedDiskSpaceNO.length <= 0) {
+ if (totalMemory == nil || totalMemory.length <= 0) {
// Invalid value
- UsedDiskSpaceNO = @"Unknown";
+ totalMemory = @"Unknown";
}
- if (UsedDiskSpaceYES == nil || UsedDiskSpaceYES.length <= 0) {
+ if (freeMemoryNO == nil || freeMemoryNO.length <= 0) {
// Invalid value
- UsedDiskSpaceYES = @"Unknown";
+ freeMemoryNO = @"Unknown";
}
- if (LongDiskSpace == nil || LongDiskSpace.length <= 0) {
+ if (freeMemoryYES == nil || freeMemoryYES.length <= 0) {
// Invalid value
- LongDiskSpace = @"Unknown";
+ freeMemoryYES = @"Unknown";
}
- if (LongFreeDiskSpace == nil || LongFreeDiskSpace.length <= 0) {
+ if (usedMemoryNO == nil || usedMemoryNO.length <= 0) {
// Invalid value
- LongFreeDiskSpace = @"Unknown";
+ usedMemoryNO = @"Unknown";
}
- if (TotalMemory == nil || TotalMemory.length <= 0) {
+ if (usedMemoryYES == nil || usedMemoryYES.length <= 0) {
// Invalid value
- TotalMemory = @"Unknown";
+ usedMemoryYES = @"Unknown";
}
- if (FreeMemoryNO == nil || FreeMemoryNO.length <= 0) {
+ if (activeMemoryNO == nil || activeMemoryNO.length <= 0) {
// Invalid value
- FreeMemoryNO = @"Unknown";
+ activeMemoryNO = @"Unknown";
}
- if (FreeMemoryYES == nil || FreeMemoryYES.length <= 0) {
+ if (activeMemoryYES == nil || activeMemoryYES.length <= 0) {
// Invalid value
- FreeMemoryYES = @"Unknown";
+ activeMemoryYES = @"Unknown";
}
- if (UsedMemoryNO == nil || UsedMemoryNO.length <= 0) {
+ if (inactiveMemoryNO == nil || inactiveMemoryNO.length <= 0) {
// Invalid value
- UsedMemoryNO = @"Unknown";
+ inactiveMemoryNO = @"Unknown";
}
- if (UsedMemoryYES == nil || UsedMemoryYES.length <= 0) {
+ if (inactiveMemoryYES == nil || inactiveMemoryYES.length <= 0) {
// Invalid value
- UsedMemoryYES = @"Unknown";
+ inactiveMemoryYES = @"Unknown";
}
- if (ActiveMemoryNO == nil || ActiveMemoryNO.length <= 0) {
+ if (wiredMemoryNO == nil || wiredMemoryNO.length <= 0) {
// Invalid value
- ActiveMemoryNO = @"Unknown";
+ wiredMemoryNO = @"Unknown";
}
- if (ActiveMemoryYES == nil || ActiveMemoryYES.length <= 0) {
+ if (wiredMemoryYES == nil || wiredMemoryYES.length <= 0) {
// Invalid value
- ActiveMemoryYES = @"Unknown";
+ wiredMemoryYES = @"Unknown";
}
- if (InactiveMemoryNO == nil || InactiveMemoryNO.length <= 0) {
+ if (purgableMemoryNO == nil || purgableMemoryNO.length <= 0) {
// Invalid value
- InactiveMemoryNO = @"Unknown";
+ purgableMemoryNO = @"Unknown";
}
- if (InactiveMemoryYES == nil || InactiveMemoryYES.length <= 0) {
+ if (purgableMemoryYES == nil || purgableMemoryYES.length <= 0) {
// Invalid value
- InactiveMemoryYES = @"Unknown";
+ purgableMemoryYES = @"Unknown";
}
- if (WiredMemoryNO == nil || WiredMemoryNO.length <= 0) {
+ if (deviceOrientation == nil || deviceOrientation.length <= 0) {
// Invalid value
- WiredMemoryNO = @"Unknown";
+ deviceOrientation = @"Unknown";
}
- if (WiredMemoryYES == nil || WiredMemoryYES.length <= 0) {
+ if (country == nil || country.length <= 0) {
// Invalid value
- WiredMemoryYES = @"Unknown";
+ country = @"Unknown";
}
- if (PurgableMemoryNO == nil || PurgableMemoryNO.length <= 0) {
+ if (language == nil || language.length <= 0) {
// Invalid value
- PurgableMemoryNO = @"Unknown";
+ language = @"Unknown";
}
- if (PurgableMemoryYES == nil || PurgableMemoryYES.length <= 0) {
+ if (timeZone == nil || timeZone.length <= 0) {
// Invalid value
- PurgableMemoryYES = @"Unknown";
+ timeZone = @"Unknown";
}
- if (DeviceOrientation == nil || DeviceOrientation.length <= 0) {
+ if (currency == nil || currency.length <= 0) {
// Invalid value
- DeviceOrientation = @"Unknown";
+ currency = @"Unknown";
}
- if (Country == nil || Country.length <= 0) {
+ if (applicationVersion == nil || applicationVersion.length <= 0) {
// Invalid value
- Country = @"Unknown";
+ applicationVersion = @"Unknown";
}
- if (Language == nil || Language.length <= 0) {
+ if (cFUUID == nil || cFUUID.length <= 0) {
// Invalid value
- Language = @"Unknown";
+ cFUUID = @"Unknown";
}
- if (TimeZone == nil || TimeZone.length <= 0) {
+ if (cPUUsage == nil || cPUUsage.length <= 0) {
// Invalid value
- TimeZone = @"Unknown";
- }
- if (Currency == nil || Currency.length <= 0) {
- // Invalid value
- Currency = @"Unknown";
- }
- if (ApplicationVersion == nil || ApplicationVersion.length <= 0) {
- // Invalid value
- ApplicationVersion = @"Unknown";
- }
- if (ClipboardContent == nil || ClipboardContent.length <= 0) {
- // Invalid value
- ClipboardContent = @"Unknown";
- }
- if (UniqueID == nil || UniqueID.length <= 0) {
- // Invalid value
- UniqueID = @"Unknown";
- }
- if (DeviceSignature == nil || DeviceSignature.length <= 0) {
- // Invalid value
- DeviceSignature = @"Unknown";
- }
- if (CFUUID == nil || CFUUID.length <= 0) {
- // Invalid value
- CFUUID = @"Unknown";
- }
- if (CPUUsage == nil || CPUUsage.length <= 0) {
- // Invalid value
- CPUUsage = @"Unknown";
+ cPUUsage = @"Unknown";
}
// Get all Information in a dictionary
- SystemInformationDict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:
- SystemUptime,
- DeviceModel,
- DeviceName,
- SystemName,
- SystemVersion,
- SystemDeviceTypeFormattedNO,
- SystemDeviceTypeFormattedYES,
- ScreenWidth,
- ScreenHeight,
- ScreenBrightness,
- MultitaskingEnabled,
- ProximitySensorEnabled,
- DebuggerAttached,
- PluggedIn,
- Jailbroken,
- NumberProcessors,
- NumberActiveProcessors,
- ProcessorSpeed,
- ProcessorBusSpeed,
- AccessoriesAttached,
- HeadphonesAttached,
- NumberAttachedAccessories,
- NameAttachedAccessories,
- CarrierName,
- CarrierCountry,
- CarrierMobileCountryCode,
- CarrierISOCountryCode,
- CarrierMobileNetworkCode,
- CarrierAllowsVOIP,
- BatteryLevel,
- Charging,
- FullyCharged,
- CurrentIPAddress,
- CurrentMACAddress,
- ExternalIPAddress,
- CellIPAddress,
- CellMACAddress,
- CellNetmaskAddress,
- CellBroadcastAddress,
- WiFiIPAddress,
- WiFiMACAddress,
- WiFiNetmaskAddress,
- WiFiBroadcastAddress,
- WiFiRouterAddress,
- ConnectedToWiFi,
- ConnectedToCellNetwork,
- ProcessID,
- ProcessName,
- ProcessStatus,
- ParentPID,
- ProcessesInformation,
- DiskSpace,
- FreeDiskSpaceNO,
- FreeDiskSpaceYES,
- UsedDiskSpaceNO,
- UsedDiskSpaceYES,
- LongDiskSpace,
- LongFreeDiskSpace,
- TotalMemory,
- FreeMemoryNO,
- FreeMemoryYES,
- UsedMemoryNO,
- UsedMemoryYES,
- ActiveMemoryNO,
- ActiveMemoryYES,
- InactiveMemoryNO,
- InactiveMemoryYES,
- WiredMemoryNO,
- WiredMemoryYES,
- PurgableMemoryNO,
- PurgableMemoryYES,
- DeviceOrientation,
- Country,
- Language,
- TimeZone,
- Currency,
- ApplicationVersion,
- ClipboardContent,
- UniqueID,
- DeviceSignature,
- CFUUID,
- CPUUsage,
+ systemInformationDict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:
+ systemUptime,
+ deviceModel,
+ deviceName,
+ systemName,
+ systemVersion,
+ systemDeviceTypeFormattedNO,
+ systemDeviceTypeFormattedYES,
+ screenWidth,
+ screenHeight,
+ screenBrightness,
+ multitaskingEnabled,
+ proximitySensorEnabled,
+ debuggerAttached,
+ pluggedIn,
+ stepCountingAvailable,
+ distanceAvailable,
+ floorCountingAvailable,
+ jailbroken,
+ numberProcessors,
+ numberActiveProcessors,
+ processorsUsage,
+ accessoriesAttached,
+ headphonesAttached,
+ numberAttachedAccessories,
+ nameAttachedAccessories,
+ carrierName,
+ carrierCountry,
+ carrierMobileCountryCode,
+ carrierISOCountryCode,
+ carrierMobileNetworkCode,
+ carrierAllowsVOIP,
+ batteryLevel,
+ charging,
+ fullyCharged,
+ currentIPAddress,
+ externalIPAddress,
+ cellIPAddress,
+ cellNetmaskAddress,
+ cellBroadcastAddress,
+ wiFiIPAddress,
+ wiFiNetmaskAddress,
+ wiFiBroadcastAddress,
+ wiFiRouterAddress,
+ connectedToWiFi,
+ connectedToCellNetwork,
+ processID,
+ diskSpace,
+ freeDiskSpaceNO,
+ freeDiskSpaceYES,
+ usedDiskSpaceNO,
+ usedDiskSpaceYES,
+ longDiskSpace,
+ longFreeDiskSpace,
+ totalMemory,
+ freeMemoryNO,
+ freeMemoryYES,
+ usedMemoryNO,
+ usedMemoryYES,
+ activeMemoryNO,
+ activeMemoryYES,
+ inactiveMemoryNO,
+ inactiveMemoryYES,
+ wiredMemoryNO,
+ wiredMemoryYES,
+ purgableMemoryNO,
+ purgableMemoryYES,
+ deviceOrientation,
+ country,
+ language,
+ timeZone,
+ currency,
+ applicationVersion,
+ cFUUID,
+ cPUUsage,
nil]
forKeys:[NSArray arrayWithObjects:
@"Uptime (dd hh mm)",
@@ -1171,11 +809,13 @@ - (NSDictionary *)getAllSystemInformation {
@"ProximitySensorEnabled",
@"DebuggerAttached",
@"PluggedIn",
+ @"StepCountingAvailable",
+ @"DistanceAvailable",
+ @"FloorCountingAvailable",
@"Jailbroken",
@"NumberProcessors",
@"NumberActiveProcessors",
- @"ProcessorSpeed",
- @"ProcessorBusSpeed",
+ @"ProcessorsUsage",
@"AccessoriesAttached",
@"HeadphonesAttached",
@"NumberAttachedAccessories",
@@ -1190,24 +830,17 @@ - (NSDictionary *)getAllSystemInformation {
@"Charging",
@"FullyCharged",
@"CurrentIPAddress",
- @"CurrentMACAddress",
@"External IP Address",
@"CellIPAddress",
- @"CellMACAddress",
@"CellNetmaskAddress",
@"CellBroadcastAddress",
@"WiFiIPAddress",
- @"WiFiMACAddress",
@"WiFiNetmaskAddress",
@"WiFiBroadcastAddress",
@"WiFiRouterAddress",
@"ConnectedToWiFi",
@"ConnectedToCellNetwork",
@"ProcessID",
- @"ProcessName",
- @"ProcessStatus",
- @"ParentPID",
- @"ProcessesInformation",
@"DiskSpace",
@"FreeDiskSpace (Not Formatted)",
@"FreeDiskSpace (Formatted)",
@@ -1234,34 +867,18 @@ - (NSDictionary *)getAllSystemInformation {
@"TimeZone",
@"Currency",
@"ApplicationVersion",
- @"ClipboardContent",
- @"UniqueID",
- @"DeviceSignature",
@"CFUUID",
@"CPUUsage",
nil]];
// Check if Dictionary is populated
- if (SystemInformationDict.count <= 0) {
+ if (systemInformationDict.count <= 0) {
// Error, Dictionary is empty
return nil;
}
// Successful
- return SystemInformationDict;
-}
-
-// Parent ID for a certain PID
-- (int)parentPIDForProcess:(int)pid {
- // Get the Parent Process ID For a process
- int Number = [SSProcessInfo parentPIDForProcess:pid];
- // Validate it
- if (Number <= 0) {
- // Error, no value returned
- return -1;
- }
- // Successful
- return Number;
+ return systemInformationDict;
}
@end
diff --git a/System Services/Utilities/SSAccelerometerInfo.m b/System Services/Utilities/SSAccelerometerInfo.m
index e04b86c..693dc9f 100755
--- a/System Services/Utilities/SSAccelerometerInfo.m
+++ b/System Services/Utilities/SSAccelerometerInfo.m
@@ -47,13 +47,14 @@ + (UIInterfaceOrientation)deviceOrientation {
@try {
#if !(defined(__has_feature) && __has_feature(attribute_availability_app_extension))
// Device orientation
- UIInterfaceOrientation Orientation = [[UIApplication sharedApplication] statusBarOrientation];
+ UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
// Successful
- return Orientation;
+ return orientation;
#endif
}
@catch (NSException *exception) {
+ return -1;
}
// Error
return -1;
diff --git a/System Services/Utilities/SSAccessoryInfo.m b/System Services/Utilities/SSAccessoryInfo.m
index bba1d46..d86834e 100755
--- a/System Services/Utilities/SSAccessoryInfo.m
+++ b/System Services/Utilities/SSAccessoryInfo.m
@@ -23,11 +23,11 @@ + (BOOL)accessoriesAttached {
// Check if any accessories are connected
@try {
// Set up the accessory manger
- EAAccessoryManager *AccessoryManager = [EAAccessoryManager sharedAccessoryManager];
+ EAAccessoryManager *accessoryManager = [EAAccessoryManager sharedAccessoryManager];
// Get the number of accessories connected
- int NumberOfAccessoriesConnected = (int)[AccessoryManager.connectedAccessories count];
+ int numberOfAccessoriesConnected = (int)[accessoryManager.connectedAccessories count];
// Check if there are any connected
- if (NumberOfAccessoriesConnected > 0) {
+ if (numberOfAccessoriesConnected > 0) {
// There are accessories connected
return true;
} else {
@@ -73,11 +73,11 @@ + (NSInteger)numberAttachedAccessories {
// Get the number of attached accessories
@try {
// Set up the accessory manger
- EAAccessoryManager *AccessoryManager = [EAAccessoryManager sharedAccessoryManager];
+ EAAccessoryManager *accessoryManager = [EAAccessoryManager sharedAccessoryManager];
// Get the number of accessories connected
- int NumberOfAccessoriesConnected = (int)[AccessoryManager.connectedAccessories count];
+ int numberOfAccessoriesConnected = (int)[accessoryManager.connectedAccessories count];
// Return how many accessories are attached
- return NumberOfAccessoriesConnected;
+ return numberOfAccessoriesConnected;
}
@catch (NSException *exception) {
// Error, return false
@@ -90,44 +90,44 @@ + (NSString *)nameAttachedAccessories {
// Get the name of the attached accessories
@try {
// Set up the accessory manger
- EAAccessoryManager *AccessoryManager = [EAAccessoryManager sharedAccessoryManager];
+ EAAccessoryManager *accessoryManager = [EAAccessoryManager sharedAccessoryManager];
// Set up an accessory (for later use)
- EAAccessory *Accessory;
+ EAAccessory *accessory;
// Get the number of accessories connected
- int NumberOfAccessoriesConnected = (int)[AccessoryManager.connectedAccessories count];
+ int numberOfAccessoriesConnected = (int)[accessoryManager.connectedAccessories count];
// Check to make sure there are accessories connected
- if (NumberOfAccessoriesConnected > 0) {
+ if (numberOfAccessoriesConnected > 0) {
// Set up a string for all the accessory names
- NSString *AllAccessoryNames = @"";
+ NSString *allAccessoryNames = @"";
// Set up a string for the accessory names
- NSString *AccessoryName;
+ NSString *accessoryName;
// Get the accessories
- NSArray *AccessoryArray = AccessoryManager.connectedAccessories;
+ NSArray *accessoryArray = accessoryManager.connectedAccessories;
// Run through all the accessories
- for (int x = 0; x < NumberOfAccessoriesConnected; x++) {
+ for (int x = 0; x < numberOfAccessoriesConnected; x++) {
// Get the accessory at that index
- Accessory = [AccessoryArray objectAtIndex:x];
+ accessory = [accessoryArray objectAtIndex:x];
// Get the name of it
- AccessoryName = [Accessory name];
+ accessoryName = [accessory name];
// Make sure there is a name
- if (AccessoryName == nil || AccessoryName.length == 0) {
+ if (accessoryName == nil || accessoryName.length == 0) {
// If there isn't, try and get the manufacturer name
- AccessoryName = [Accessory manufacturer];
+ accessoryName = [accessory manufacturer];
}
// Make sure there is a manufacturer name
- if (AccessoryName == nil || AccessoryName.length == 0) {
+ if (accessoryName == nil || accessoryName.length == 0) {
// If there isn't a manufacturer name still
- AccessoryName = @"Unknown";
+ accessoryName = @"Unknown";
}
// Format that name
- AllAccessoryNames = [AllAccessoryNames stringByAppendingFormat:@"%@", AccessoryName];
- if (x < NumberOfAccessoriesConnected - 1) {
- AllAccessoryNames = [AllAccessoryNames stringByAppendingFormat:@", "];
+ allAccessoryNames = [allAccessoryNames stringByAppendingFormat:@"%@", accessoryName];
+ if (x < numberOfAccessoriesConnected - 1) {
+ allAccessoryNames = [allAccessoryNames stringByAppendingFormat:@", "];
}
}
// Return the name/s of the connected accessories
- return AllAccessoryNames;
+ return allAccessoryNames;
} else {
// No accessories connected
return nil;
diff --git a/System Services/Utilities/SSApplicationInfo.m b/System Services/Utilities/SSApplicationInfo.m
index 0be903a..4699790 100755
--- a/System Services/Utilities/SSApplicationInfo.m
+++ b/System Services/Utilities/SSApplicationInfo.m
@@ -24,15 +24,15 @@ + (NSString *)applicationVersion {
@try {
// Query the plist for the version
- NSString *Version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
+ NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
// Validate the Version
- if (Version == nil || Version.length <= 0) {
+ if (version == nil || version.length <= 0) {
// Invalid Version number
return nil;
}
// Successful
- return Version;
+ return version;
}
@catch (NSException *exception) {
// Error
@@ -45,16 +45,16 @@ + (NSString *)clipboardContent {
// Get the string content of the clipboard (copy, paste)
@try {
// Get the Pasteboard
- UIPasteboard *PasteBoard = [UIPasteboard generalPasteboard];
+ UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard];
// Get the string value of the pasteboard
- NSString *ClipboardContent = [PasteBoard string];
+ NSString *clipboardContent = [pasteBoard string];
// Check for validity
- if (ClipboardContent == nil || ClipboardContent.length <= 0) {
+ if (clipboardContent == nil || clipboardContent.length <= 0) {
// Error, invalid pasteboard
return nil;
}
// Successful
- return ClipboardContent;
+ return clipboardContent;
}
@catch (NSException *exception) {
// Error
diff --git a/System Services/Utilities/SSBatteryInfo.m b/System Services/Utilities/SSBatteryInfo.m
index 91e3b9c..da73c51 100755
--- a/System Services/Utilities/SSBatteryInfo.m
+++ b/System Services/Utilities/SSBatteryInfo.m
@@ -20,26 +20,26 @@ + (float)batteryLevel {
// Find the battery level
@try {
// Get the device
- UIDevice *Device = [UIDevice currentDevice];
+ UIDevice *device = [UIDevice currentDevice];
// Set battery monitoring on
- Device.batteryMonitoringEnabled = YES;
+ device.batteryMonitoringEnabled = YES;
// Set up the battery level float
- float BatteryLevel = 0.0;
+ float batteryLevel = 0.0;
// Get the battery level
- float BatteryCharge = [Device batteryLevel];
+ float batteryCharge = [device batteryLevel];
// Check to make sure the battery level is more than zero
- if (BatteryCharge > 0.0f) {
+ if (batteryCharge > 0.0f) {
// Make the battery level float equal to the charge * 100
- BatteryLevel = BatteryCharge * 100;
+ batteryLevel = batteryCharge * 100;
} else {
// Unable to find the battery level
return -1;
}
// Output the battery level
- return BatteryLevel;
+ return batteryLevel;
}
@catch (NSException *exception) {
// Error out
@@ -52,12 +52,12 @@ + (BOOL)charging {
// Is the battery charging?
@try {
// Get the device
- UIDevice *Device = [UIDevice currentDevice];
+ UIDevice *device = [UIDevice currentDevice];
// Set battery monitoring on
- Device.batteryMonitoringEnabled = YES;
+ device.batteryMonitoringEnabled = YES;
// Check the battery state
- if ([Device batteryState] == UIDeviceBatteryStateCharging || [Device batteryState] == UIDeviceBatteryStateFull) {
+ if ([device batteryState] == UIDeviceBatteryStateCharging || [device batteryState] == UIDeviceBatteryStateFull) {
// Device is charging
return true;
} else {
@@ -76,12 +76,12 @@ + (BOOL)fullyCharged {
// Is the battery fully charged?
@try {
// Get the device
- UIDevice *Device = [UIDevice currentDevice];
+ UIDevice *device = [UIDevice currentDevice];
// Set battery monitoring on
- Device.batteryMonitoringEnabled = YES;
+ device.batteryMonitoringEnabled = YES;
// Check the battery state
- if ([Device batteryState] == UIDeviceBatteryStateFull) {
+ if ([device batteryState] == UIDeviceBatteryStateFull) {
// Device is fully charged
return true;
} else {
diff --git a/System Services/Utilities/SSCarrierInfo.m b/System Services/Utilities/SSCarrierInfo.m
index eb10e7f..32be00b 100755
--- a/System Services/Utilities/SSCarrierInfo.m
+++ b/System Services/Utilities/SSCarrierInfo.m
@@ -21,20 +21,20 @@ + (NSString *)carrierName {
// Get the carrier name
@try {
// Get the Telephony Network Info
- CTTelephonyNetworkInfo *TelephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
+ CTTelephonyNetworkInfo *telephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
// Get the carrier
- CTCarrier *Carrier = [TelephonyInfo subscriberCellularProvider];
+ CTCarrier *carrier = [telephonyInfo subscriberCellularProvider];
// Get the carrier name
- NSString *CarrierName = [Carrier carrierName];
+ NSString *carrierName = [carrier carrierName];
// Check to make sure it's valid
- if (CarrierName == nil || CarrierName.length <= 0) {
+ if (carrierName == nil || carrierName.length <= 0) {
// Return unknown
return nil;
}
// Return the name
- return CarrierName;
+ return carrierName;
}
@catch (NSException *exception) {
// Error finding the name
@@ -47,16 +47,16 @@ + (NSString *)carrierCountry {
// Get the country that the carrier is located in
@try {
// Get the locale
- NSLocale *CurrentCountry = [NSLocale currentLocale];
+ NSLocale *currentCountry = [NSLocale currentLocale];
// Get the country Code
- NSString *Country = [CurrentCountry objectForKey:NSLocaleCountryCode];
+ NSString *country = [currentCountry objectForKey:NSLocaleCountryCode];
// Check if it returned anything
- if (Country == nil || Country.length <= 0) {
+ if (country == nil || country.length <= 0) {
// No country found
return nil;
}
// Return the country
- return Country;
+ return country;
}
@catch (NSException *exception) {
// Failed, return nil
@@ -69,20 +69,20 @@ + (NSString *)carrierMobileCountryCode {
// Get the carrier mobile country code
@try {
// Get the Telephony Network Info
- CTTelephonyNetworkInfo *TelephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
+ CTTelephonyNetworkInfo *telephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
// Get the carrier
- CTCarrier *Carrier = [TelephonyInfo subscriberCellularProvider];
+ CTCarrier *carrier = [telephonyInfo subscriberCellularProvider];
// Get the carrier mobile country code
- NSString *CarrierCode = [Carrier mobileCountryCode];
+ NSString *carrierCode = [carrier mobileCountryCode];
// Check to make sure it's valid
- if (CarrierCode == nil || CarrierCode.length <= 0) {
+ if (carrierCode == nil || carrierCode.length <= 0) {
// Return unknown
return nil;
}
// Return the name
- return CarrierCode;
+ return carrierCode;
}
@catch (NSException *exception) {
// Error finding the name
@@ -95,20 +95,20 @@ + (NSString *)carrierISOCountryCode {
// Get the carrier ISO country code
@try {
// Get the Telephony Network Info
- CTTelephonyNetworkInfo *TelephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
+ CTTelephonyNetworkInfo *telephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
// Get the carrier
- CTCarrier *Carrier = [TelephonyInfo subscriberCellularProvider];
+ CTCarrier *carrier = [telephonyInfo subscriberCellularProvider];
// Get the carrier ISO country code
- NSString *CarrierCode = [Carrier isoCountryCode];
+ NSString *carrierCode = [carrier isoCountryCode];
// Check to make sure it's valid
- if (CarrierCode == nil || CarrierCode.length <= 0) {
+ if (carrierCode == nil || carrierCode.length <= 0) {
// Return unknown
return nil;
}
// Return the name
- return CarrierCode;
+ return carrierCode;
}
@catch (NSException *exception) {
// Error finding the name
@@ -121,20 +121,20 @@ + (NSString *)carrierMobileNetworkCode {
// Get the carrier mobile network code
@try {
// Get the Telephony Network Info
- CTTelephonyNetworkInfo *TelephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
+ CTTelephonyNetworkInfo *telephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
// Get the carrier
- CTCarrier *Carrier = [TelephonyInfo subscriberCellularProvider];
+ CTCarrier *carrier = [telephonyInfo subscriberCellularProvider];
// Get the carrier mobile network code
- NSString *CarrierCode = [Carrier mobileNetworkCode];
+ NSString *carrierCode = [carrier mobileNetworkCode];
// Check to make sure it's valid
- if (CarrierCode == nil || CarrierCode.length <= 0) {
+ if (carrierCode == nil || carrierCode.length <= 0) {
// Return unknown
return nil;
}
// Return the name
- return CarrierCode;
+ return carrierCode;
}
@catch (NSException *exception) {
// Error finding the name
@@ -147,14 +147,14 @@ + (BOOL)carrierAllowsVOIP {
// Check if the carrier allows VOIP
@try {
// Get the Telephony Network Info
- CTTelephonyNetworkInfo *TelephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
+ CTTelephonyNetworkInfo *telephonyInfo = [[CTTelephonyNetworkInfo alloc] init];
// Get the carrier
- CTCarrier *Carrier = [TelephonyInfo subscriberCellularProvider];
+ CTCarrier *carrier = [telephonyInfo subscriberCellularProvider];
// Get the carrier VOIP Status
- BOOL CarrierVOIP = [Carrier allowsVOIP];
+ BOOL carrierVOIP = [carrier allowsVOIP];
// Return the VOIP Status
- return CarrierVOIP;
+ return carrierVOIP;
}
@catch (NSException *exception) {
// Error finding the VOIP Status
diff --git a/System Services/Utilities/SSDiskInfo.m b/System Services/Utilities/SSDiskInfo.m
index eb4560f..80d1a5d 100755
--- a/System Services/Utilities/SSDiskInfo.m
+++ b/System Services/Utilities/SSDiskInfo.m
@@ -9,8 +9,8 @@
#import "SSDiskInfo.h"
// Memory Info
-#define MB (1024*1024)
-#define GB (MB*1024)
+#define MB (1000*1000)
+#define GB (MB*1000)
@implementation SSDiskInfo
@@ -21,25 +21,25 @@ + (NSString *)diskSpace {
// Get the total disk space
@try {
// Get the long total disk space
- long long Space = [self longDiskSpace];
+ long long space = [self longDiskSpace];
// Check to make sure it's valid
- if (Space <= 0) {
+ if (space <= 0) {
// Error, no disk space found
return nil;
}
// Turn that long long into a string
- NSString *DiskSpace = [self formatMemory:Space];
+ NSString *diskSpace = [self formatMemory:space];
// Check to make sure it's valid
- if (DiskSpace == nil || DiskSpace.length <= 0) {
+ if (diskSpace == nil || diskSpace.length <= 0) {
// Error, diskspace not given
return nil;
}
// Return successful
- return DiskSpace;
+ return diskSpace;
}
@catch (NSException * ex) {
// Error
@@ -61,7 +61,7 @@ + (NSString *)freeDiskSpace:(BOOL)inPercent {
}
// Set up the string output variable
- NSString *DiskSpace;
+ NSString *diskSpace;
// If the user wants the output in percentage
if (inPercent) {
@@ -75,20 +75,20 @@ + (NSString *)freeDiskSpace:(BOOL)inPercent {
return nil;
}
// Convert that float to a string
- DiskSpace = [NSString stringWithFormat:@"%.f%%", PercentDiskSpace];
+ diskSpace = [NSString stringWithFormat:@"%.f%%", PercentDiskSpace];
} else {
// Turn that long long into a string
- DiskSpace = [self formatMemory:Space];
+ diskSpace = [self formatMemory:Space];
}
// Check to make sure it's valid
- if (DiskSpace == nil || DiskSpace.length <= 0) {
+ if (diskSpace == nil || diskSpace.length <= 0) {
// Error, diskspace not given
return nil;
}
// Return successful
- return DiskSpace;
+ return diskSpace;
}
@catch (NSException * ex) {
// Error
@@ -101,54 +101,54 @@ + (NSString *)usedDiskSpace:(BOOL)inPercent {
// Get the total used disk space
@try {
// Make a variable to hold the Used Disk Space
- long long UDS;
+ long long uds;
// Get the long total disk space
- long long TDS = [self longDiskSpace];
+ long long tds = [self longDiskSpace];
// Get the long free disk space
- long long FDS = [self longFreeDiskSpace];
+ long long fds = [self longFreeDiskSpace];
// Make sure they're valid
- if (TDS <= 0 || FDS <= 0) {
+ if (tds <= 0 || fds <= 0) {
// Error, invalid values
return nil;
}
// Now subtract the free space from the total space
- UDS = TDS - FDS;
+ uds = tds - fds;
// Make sure it's valid
- if (UDS <= 0) {
+ if (uds <= 0) {
// Error, invalid value
return nil;
}
// Set up the string output variable
- NSString *UsedDiskSpace;
+ NSString *usedDiskSpace;
// If the user wants the output in percentage
if (inPercent) {
// Make a float to get the percent of those values
- float PercentUsedDiskSpace = (UDS * 100) / TDS;
+ float percentUsedDiskSpace = (uds * 100) / tds;
// Check it to make sure it's okay
- if (PercentUsedDiskSpace <= 0) {
+ if (percentUsedDiskSpace <= 0) {
// Error, invalid percent
return nil;
}
// Convert that float to a string
- UsedDiskSpace = [NSString stringWithFormat:@"%.f%%", PercentUsedDiskSpace];
+ usedDiskSpace = [NSString stringWithFormat:@"%.f%%", percentUsedDiskSpace];
} else {
// Turn that long long into a string
- UsedDiskSpace = [self formatMemory:UDS];
+ usedDiskSpace = [self formatMemory:uds];
}
// Check to make sure it's valid
- if (UsedDiskSpace == nil || UsedDiskSpace.length <= 0) {
+ if (usedDiskSpace == nil || usedDiskSpace.length <= 0) {
// Error, diskspace not given
return nil;
}
// Return successful
- return UsedDiskSpace;
+ return usedDiskSpace;
// Now convert that to a string
}
@@ -165,27 +165,27 @@ + (long long)longDiskSpace {
// Get the long long disk space
@try {
// Set up variables
- long long DiskSpace = 0L;
- NSError *Error = nil;
- NSDictionary *FileAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&Error];
+ long long diskSpace = 0L;
+ NSError *error = nil;
+ NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error];
// Get the file attributes of the home directory assuming no errors
- if (Error == nil) {
+ if (error == nil) {
// Get the size of the filesystem
- DiskSpace = [[FileAttributes objectForKey:NSFileSystemSize] longLongValue];
+ diskSpace = [[fileAttributes objectForKey:NSFileSystemSize] longLongValue];
} else {
// Error, return nil
return -1;
}
// Check to make sure it's a valid size
- if (DiskSpace <= 0) {
+ if (diskSpace <= 0) {
// Invalid size
return -1;
}
// Successful
- return DiskSpace;
+ return diskSpace;
}
@catch (NSException *exception) {
// Error
@@ -199,12 +199,12 @@ + (long long)longFreeDiskSpace {
@try {
// Set up the variables
long long FreeDiskSpace = 0L;
- NSError *Error = nil;
- NSDictionary *FileAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&Error];
+ NSError *error = nil;
+ NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error];
// Get the file attributes of the home directory assuming no errors
- if (Error == nil) {
- FreeDiskSpace = [[FileAttributes objectForKey:NSFileSystemFreeSize] longLongValue];
+ if (error == nil) {
+ FreeDiskSpace = [[fileAttributes objectForKey:NSFileSystemFreeSize] longLongValue];
} else {
// There was an error
return -1;
@@ -232,31 +232,31 @@ + (NSString *)formatMemory:(long long)Space {
// Format the long long disk space
@try {
// Set up the string
- NSString *FormattedBytes = nil;
+ NSString *formattedBytes = nil;
// Get the bytes, megabytes, and gigabytes
- double NumberBytes = 1.0 * Space;
- double TotalGB = NumberBytes / GB;
- double TotalMB = NumberBytes / MB;
+ double numberBytes = 1.0 * Space;
+ double totalGB = numberBytes / GB;
+ double totalMB = numberBytes / MB;
// Display them appropriately
- if (TotalGB >= 1.0) {
- FormattedBytes = [NSString stringWithFormat:@"%.2f GB", TotalGB];
- } else if (TotalMB >= 1)
- FormattedBytes = [NSString stringWithFormat:@"%.2f MB", TotalMB];
+ if (totalGB >= 1.0) {
+ formattedBytes = [NSString stringWithFormat:@"%.2f GB", totalGB];
+ } else if (totalMB >= 1)
+ formattedBytes = [NSString stringWithFormat:@"%.2f MB", totalMB];
else {
- FormattedBytes = [self formattedMemory:Space];
- FormattedBytes = [FormattedBytes stringByAppendingString:@" bytes"];
+ formattedBytes = [self formattedMemory:Space];
+ formattedBytes = [formattedBytes stringByAppendingString:@" bytes"];
}
// Check for errors
- if (FormattedBytes == nil || FormattedBytes.length <= 0) {
+ if (formattedBytes == nil || formattedBytes.length <= 0) {
// Error, invalid string
return nil;
}
// Completed Successfully
- return FormattedBytes;
+ return formattedBytes;
}
@catch (NSException *exception) {
// Error
@@ -269,28 +269,28 @@ + (NSString *)formattedMemory:(unsigned long long)Space {
// Format for bytes
@try {
// Set up the string variable
- NSString *FormattedBytes = nil;
+ NSString *formattedBytes = nil;
// Set up the format variable
- NSNumberFormatter *Formatter = [[NSNumberFormatter alloc] init];
+ NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
// Format the bytes
- [Formatter setPositiveFormat:@"###,###,###,###"];
+ [formatter setPositiveFormat:@"###,###,###,###"];
// Get the bytes
- NSNumber * theNumber = [NSNumber numberWithLongLong:Space];
+ NSNumber *theNumber = [NSNumber numberWithLongLong:Space];
// Format the bytes appropriately
- FormattedBytes = [Formatter stringFromNumber:theNumber];
+ formattedBytes = [formatter stringFromNumber:theNumber];
// Check for errors
- if (FormattedBytes == nil || FormattedBytes.length <= 0) {
+ if (formattedBytes == nil || formattedBytes.length <= 0) {
// Error, invalid value
return nil;
}
// Completed Successfully
- return FormattedBytes;
+ return formattedBytes;
}
@catch (NSException *exception) {
// Error
diff --git a/System Services/Utilities/SSHardwareInfo.h b/System Services/Utilities/SSHardwareInfo.h
index f0eaab9..81405b8 100755
--- a/System Services/Utilities/SSHardwareInfo.h
+++ b/System Services/Utilities/SSHardwareInfo.h
@@ -51,4 +51,13 @@
// Plugged In?
+ (BOOL)pluggedIn;
+// Step-Counting Available?
++ (BOOL)stepCountingAvailable;
+
+// Distance Available
++ (BOOL)distanceAvailable;
+
+// Floor Counting Available
++ (BOOL)floorCountingAvailable;
+
@end
diff --git a/System Services/Utilities/SSHardwareInfo.m b/System Services/Utilities/SSHardwareInfo.m
index a589f33..0073714 100755
--- a/System Services/Utilities/SSHardwareInfo.m
+++ b/System Services/Utilities/SSHardwareInfo.m
@@ -11,11 +11,16 @@
// UIKit
#import
+// Core Motion
+#import
+
// sysctl
#import
// utsname
#import
+static BOOL sCachedIsProximityEnabled = false;
+
@implementation SSHardwareInfo
// System Hardware Information
@@ -23,39 +28,39 @@ @implementation SSHardwareInfo
// System Uptime (dd hh mm)
+ (NSString *)systemUptime {
// Set up the days/hours/minutes
- NSNumber *Days, *Hours, *Minutes;
-
+ NSNumber *days, *hours, *minutes;
+
// Get the info about a process
- NSProcessInfo * processInfo = [NSProcessInfo processInfo];
- // Get the uptime of the system
- NSTimeInterval UptimeInterval = [processInfo systemUptime];
- // Get the calendar
- NSCalendar *Calendar = [NSCalendar currentCalendar];
- // Create the Dates
- NSDate *Date = [[NSDate alloc] initWithTimeIntervalSinceNow:(0-UptimeInterval)];
+ NSProcessInfo *processInfo = [NSProcessInfo processInfo];
+ // Get the uptime of the system
+ NSTimeInterval uptimeInterval = [processInfo systemUptime];
+ // Get the calendar
+ NSCalendar *calendar = [NSCalendar currentCalendar];
+ // Create the Dates
+ NSDate *date = [[NSDate alloc] initWithTimeIntervalSinceNow:(0-uptimeInterval)];
unsigned int unitFlags = NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute;
- NSDateComponents *Components = [Calendar components:unitFlags fromDate:Date toDate:[NSDate date] options:0];
-
+ NSDateComponents *components = [calendar components:unitFlags fromDate:date toDate:[NSDate date] options:0];
+
// Get the day, hour and minutes
- Days = [NSNumber numberWithLong:[Components day]];
- Hours = [NSNumber numberWithLong:[Components hour]];
- Minutes = [NSNumber numberWithLong:[Components minute]];
-
+ days = [NSNumber numberWithLong:[components day]];
+ hours = [NSNumber numberWithLong:[components hour]];
+ minutes = [NSNumber numberWithLong:[components minute]];
+
// Format the dates
- NSString *Uptime = [NSString stringWithFormat:@"%@ %@ %@",
- [Days stringValue],
- [Hours stringValue],
- [Minutes stringValue]];
-
+ NSString *uptime = [NSString stringWithFormat:@"%@ %@ %@",
+ [days stringValue],
+ [hours stringValue],
+ [minutes stringValue]];
+
// Error checking
- if (!Uptime) {
+ if (!uptime) {
// No uptime found
// Return nil
return nil;
}
-
+
// Return the uptime
- return Uptime;
+ return uptime;
}
// Model of Device
@@ -117,128 +122,200 @@ + (NSString *)systemVersion {
// System Device Type (iPhone1,0) (Formatted = iPhone 1)
+ (NSString *)systemDeviceTypeFormatted:(BOOL)formatted {
// Set up a Device Type String
- NSString *DeviceType;
-
+ NSString *deviceType;
+
// Check if it should be formatted
if (formatted) {
// Formatted
@try {
// Set up a new Device Type String
- NSString *NewDeviceType;
+ NSString *newDeviceType;
// Set up a struct
- struct utsname DT;
+ struct utsname dt;
// Get the system information
- uname(&DT);
+ uname(&dt);
// Set the device type to the machine type
- DeviceType = [NSString stringWithFormat:@"%s", DT.machine];
-
- if ([DeviceType isEqualToString:@"i386"])
- NewDeviceType = @"iPhone Simulator";
- else if ([DeviceType isEqualToString:@"x86_64"])
- NewDeviceType = @"iPhone Simulator";
- else if ([DeviceType isEqualToString:@"iPhone1,1"])
- NewDeviceType = @"iPhone";
- else if ([DeviceType isEqualToString:@"iPhone1,2"])
- NewDeviceType = @"iPhone 3G";
- else if ([DeviceType isEqualToString:@"iPhone2,1"])
- NewDeviceType = @"iPhone 3GS";
- else if ([DeviceType isEqualToString:@"iPhone3,1"])
- NewDeviceType = @"iPhone 4";
- else if ([DeviceType isEqualToString:@"iPhone4,1"])
- NewDeviceType = @"iPhone 4S";
- else if ([DeviceType isEqualToString:@"iPhone5,1"])
- NewDeviceType = @"iPhone 5(GSM)";
- else if ([DeviceType isEqualToString:@"iPhone5,2"])
- NewDeviceType = @"iPhone 5(GSM+CDMA)";
- else if ([DeviceType isEqualToString:@"iPhone5,3"])
- NewDeviceType = @"iPhone 5c(GSM)";
- else if ([DeviceType isEqualToString:@"iPhone5,4"])
- NewDeviceType = @"iPhone 5c(GSM+CDMA)";
- else if ([DeviceType isEqualToString:@"iPhone6,1"])
- NewDeviceType = @"iPhone 5s(GSM)";
- else if ([DeviceType isEqualToString:@"iPhone6,2"])
- NewDeviceType = @"iPhone 5s(GSM+CDMA)";
- else if ([DeviceType isEqualToString:@"iPhone7,1"])
- NewDeviceType = @"iPhone 6 Plus";
- else if ([DeviceType isEqualToString:@"iPhone7,2"])
- NewDeviceType = @"iPhone 6";
- else if ([DeviceType isEqualToString:@"iPhone8,1"])
- NewDeviceType = @"iPhone 6s";
- else if ([DeviceType isEqualToString:@"iPhone8,2"])
- NewDeviceType = @"iPhone 6s Plus";
- else if ([DeviceType isEqualToString:@"iPhone8,4"])
- NewDeviceType = @"iPhone SE";
- else if ([DeviceType isEqualToString:@"iPod1,1"])
- NewDeviceType = @"iPod Touch 1G";
- else if ([DeviceType isEqualToString:@"iPod2,1"])
- NewDeviceType = @"iPod Touch 2G";
- else if ([DeviceType isEqualToString:@"iPod3,1"])
- NewDeviceType = @"iPod Touch 3G";
- else if ([DeviceType isEqualToString:@"iPod4,1"])
- NewDeviceType = @"iPod Touch 4G";
- else if ([DeviceType isEqualToString:@"iPod5,1"])
- NewDeviceType = @"iPod Touch 5G";
- else if ([DeviceType isEqualToString:@"iPod7,1"])
- NewDeviceType = @"iPod Touch 6G";
- else if ([DeviceType isEqualToString:@"iPad1,1"])
- NewDeviceType = @"iPad";
- else if ([DeviceType isEqualToString:@"iPad2,1"])
- NewDeviceType = @"iPad 2(WiFi)";
- else if ([DeviceType isEqualToString:@"iPad2,2"])
- NewDeviceType = @"iPad 2(GSM)";
- else if ([DeviceType isEqualToString:@"iPad2,3"])
- NewDeviceType = @"iPad 2(CDMA)";
- else if ([DeviceType isEqualToString:@"iPad2,4"])
- NewDeviceType = @"iPad 2(WiFi + New Chip)";
- else if ([DeviceType isEqualToString:@"iPad2,5"])
- NewDeviceType = @"iPad mini(WiFi)";
- else if ([DeviceType isEqualToString:@"iPad2,6"])
- NewDeviceType = @"iPad mini(GSM)";
- else if ([DeviceType isEqualToString:@"iPad2,7"])
- NewDeviceType = @"iPad mini(GSM+CDMA)";
- else if ([DeviceType isEqualToString:@"iPad3,1"])
- NewDeviceType = @"iPad 3(WiFi)";
- else if ([DeviceType isEqualToString:@"iPad3,2"])
- NewDeviceType = @"iPad 3(GSM+CDMA)";
- else if ([DeviceType isEqualToString:@"iPad3,3"])
- NewDeviceType = @"iPad 3(GSM)";
- else if ([DeviceType isEqualToString:@"iPad3,4"])
- NewDeviceType = @"iPad 4(WiFi)";
- else if ([DeviceType isEqualToString:@"iPad3,5"])
- NewDeviceType = @"iPad 4(GSM)";
- else if ([DeviceType isEqualToString:@"iPad3,6"])
- NewDeviceType = @"iPad 4(GSM+CDMA)";
- else if ([DeviceType isEqualToString:@"iPad3,3"])
- NewDeviceType = @"New iPad";
- else if ([DeviceType isEqualToString:@"iPad4,1"])
- NewDeviceType = @"iPad Air(WiFi)";
- else if ([DeviceType isEqualToString:@"iPad4,2"])
- NewDeviceType = @"iPad Air(Cellular)";
- else if ([DeviceType isEqualToString:@"iPad4,4"])
- NewDeviceType = @"iPad mini 2(WiFi)";
- else if ([DeviceType isEqualToString:@"iPad4,5"])
- NewDeviceType = @"iPad mini 2(Cellular)";
- else if ([DeviceType isEqualToString:@"iPad5,1"])
- NewDeviceType = @"iPad mini 4(WiFi)";
- else if ([DeviceType isEqualToString:@"iPad5,2"])
- NewDeviceType = @"iPad mini 4(Cellular)";
- else if ([DeviceType isEqualToString:@"iPad5,4"])
- NewDeviceType = @"iPad Air 2(WiFi)";
- else if ([DeviceType isEqualToString:@"iPad5,5"])
- NewDeviceType = @"iPad Air 2(Cellular)";
- else if ([DeviceType isEqualToString:@"iPad6,3"])
- NewDeviceType = @"9.7-inch iPad Pro(WiFi)";
- else if ([DeviceType isEqualToString:@"iPad6,4"])
- NewDeviceType = @"9.7-inch iPad Pro(Cellular)";
- else if ([DeviceType isEqualToString:@"iPad6,7"])
- NewDeviceType = @"12.9-inch iPad Pro(WiFi)";
- else if ([DeviceType isEqualToString:@"iPad6,8"])
- NewDeviceType = @"12.9-inch iPad Pro(Cellular)";
- else if ([DeviceType hasPrefix:@"iPad"])
- NewDeviceType = @"iPad";
-
+ deviceType = [NSString stringWithFormat:@"%s", dt.machine];
+
+ // Simulators
+ if ([deviceType isEqualToString:@"i386"])
+ newDeviceType = @"iPhone Simulator";
+ else if ([deviceType isEqualToString:@"x86_64"])
+ newDeviceType = @"iPhone Simulator";
+ // iPhones
+ else if ([deviceType isEqualToString:@"iPhone1,1"])
+ newDeviceType = @"iPhone";
+ else if ([deviceType isEqualToString:@"iPhone1,2"])
+ newDeviceType = @"iPhone 3G";
+ else if ([deviceType isEqualToString:@"iPhone2,1"])
+ newDeviceType = @"iPhone 3GS";
+ else if ([deviceType isEqualToString:@"iPhone3,1"])
+ newDeviceType = @"iPhone 4";
+ else if ([deviceType isEqualToString:@"iPhone4,1"])
+ newDeviceType = @"iPhone 4S";
+ else if ([deviceType isEqualToString:@"iPhone5,1"])
+ newDeviceType = @"iPhone 5 (GSM)";
+ else if ([deviceType isEqualToString:@"iPhone5,2"])
+ newDeviceType = @"iPhone 5 (GSM+CDMA)";
+ else if ([deviceType isEqualToString:@"iPhone5,3"])
+ newDeviceType = @"iPhone 5c (GSM)";
+ else if ([deviceType isEqualToString:@"iPhone5,4"])
+ newDeviceType = @"iPhone 5c (GSM+CDMA)";
+ else if ([deviceType isEqualToString:@"iPhone6,1"])
+ newDeviceType = @"iPhone 5s (GSM)";
+ else if ([deviceType isEqualToString:@"iPhone6,2"])
+ newDeviceType = @"iPhone 5s (GSM+CDMA)";
+ else if ([deviceType isEqualToString:@"iPhone7,1"])
+ newDeviceType = @"iPhone 6 Plus";
+ else if ([deviceType isEqualToString:@"iPhone7,2"])
+ newDeviceType = @"iPhone 6";
+ else if ([deviceType isEqualToString:@"iPhone8,1"])
+ newDeviceType = @"iPhone 6s";
+ else if ([deviceType isEqualToString:@"iPhone8,2"])
+ newDeviceType = @"iPhone 6s Plus";
+ else if ([deviceType isEqualToString:@"iPhone8,4"])
+ newDeviceType = @"iPhone SE";
+ else if ([deviceType isEqualToString:@"iPhone9,1"])
+ newDeviceType = @"iPhone 7 (CDMA+GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone9,3"])
+ newDeviceType = @"iPhone 7 (GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone9,2"])
+ newDeviceType = @"iPhone 7 Plus (CDMA+GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone9,4"])
+ newDeviceType = @"iPhone 7 Plus (GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone10,1"])
+ newDeviceType = @"iPhone 8 (CDMA+GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone10,2"])
+ newDeviceType = @"iPhone 8 Plus (CDMA+GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone10,3"])
+ newDeviceType = @"iPhone X (CDMA+GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone10,4"])
+ newDeviceType = @"iPhone 8 (GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone10,5"])
+ newDeviceType = @"iPhone 8 Plus (GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone10,6"])
+ newDeviceType = @"iPhone X (GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone11,2"])
+ newDeviceType = @"iPhone XS";
+ else if ([deviceType isEqualToString:@"iPhone11,4"])
+ newDeviceType = @"iPhone XS MAX";
+ else if ([deviceType isEqualToString:@"iPhone11,6"])
+ newDeviceType = @"iPhone XS MAX (CDMA+GSM/LTE)";
+ else if ([deviceType isEqualToString:@"iPhone11,8"])
+ newDeviceType = @"iPhone XR";
+ // iPods
+ else if ([deviceType isEqualToString:@"iPod1,1"])
+ newDeviceType = @"iPod Touch 1G";
+ else if ([deviceType isEqualToString:@"iPod2,1"])
+ newDeviceType = @"iPod Touch 2G";
+ else if ([deviceType isEqualToString:@"iPod3,1"])
+ newDeviceType = @"iPod Touch 3G";
+ else if ([deviceType isEqualToString:@"iPod4,1"])
+ newDeviceType = @"iPod Touch 4G";
+ else if ([deviceType isEqualToString:@"iPod5,1"])
+ newDeviceType = @"iPod Touch 5G";
+ else if ([deviceType isEqualToString:@"iPod7,1"])
+ newDeviceType = @"iPod Touch 6G";
+ // iPads
+ else if ([deviceType isEqualToString:@"iPad1,1"])
+ newDeviceType = @"iPad";
+ else if ([deviceType isEqualToString:@"iPad2,1"])
+ newDeviceType = @"iPad 2 (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad2,2"])
+ newDeviceType = @"iPad 2 (GSM)";
+ else if ([deviceType isEqualToString:@"iPad2,3"])
+ newDeviceType = @"iPad 2 (CDMA)";
+ else if ([deviceType isEqualToString:@"iPad2,4"])
+ newDeviceType = @"iPad 2 (WiFi + New Chip)";
+ else if ([deviceType isEqualToString:@"iPad2,5"])
+ newDeviceType = @"iPad mini (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad2,6"])
+ newDeviceType = @"iPad mini (GSM)";
+ else if ([deviceType isEqualToString:@"iPad2,7"])
+ newDeviceType = @"iPad mini (GSM+CDMA)";
+ else if ([deviceType isEqualToString:@"iPad3,1"])
+ newDeviceType = @"iPad 3 (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad3,2"])
+ newDeviceType = @"iPad 3 (GSM)";
+ else if ([deviceType isEqualToString:@"iPad3,3"])
+ newDeviceType = @"iPad 3 (GSM+CDMA)";
+ else if ([deviceType isEqualToString:@"iPad3,4"])
+ newDeviceType = @"iPad 4 (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad3,5"])
+ newDeviceType = @"iPad 4 (GSM)";
+ else if ([deviceType isEqualToString:@"iPad3,6"])
+ newDeviceType = @"iPad 4 (GSM+CDMA)";
+ else if ([deviceType isEqualToString:@"iPad4,1"])
+ newDeviceType = @"iPad Air (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad4,2"])
+ newDeviceType = @"iPad Air (Cellular)";
+ else if ([deviceType isEqualToString:@"iPad4,3"])
+ newDeviceType = @"iPad Air (China)";
+ else if ([deviceType isEqualToString:@"iPad4,4"])
+ newDeviceType = @"iPad mini 2 (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad4,5"])
+ newDeviceType = @"iPad mini 2 (Cellular)";
+ else if ([deviceType isEqualToString:@"iPad5,1"])
+ newDeviceType = @"iPad mini 4 (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad5,2"])
+ newDeviceType = @"iPad mini 4 (Cellular)";
+ else if ([deviceType isEqualToString:@"iPad5,4"])
+ newDeviceType = @"iPad Air 2 (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad5,5"])
+ newDeviceType = @"iPad Air 2 (Cellular)";
+ else if ([deviceType isEqualToString:@"iPad6,3"])
+ newDeviceType = @"9.7-inch iPad Pro (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad6,4"])
+ newDeviceType = @"9.7-inch iPad Pro (Cellular)";
+ else if ([deviceType isEqualToString:@"iPad6,7"])
+ newDeviceType = @"12.9-inch iPad Pro (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad6,8"])
+ newDeviceType = @"12.9-inch iPad Pro (Cellular)";
+ else if ([deviceType isEqualToString:@"iPad6,11"])
+ newDeviceType = @"iPad 5 (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad6,12"])
+ newDeviceType = @"iPad 5 (Cellular)";
+ else if ([deviceType isEqualToString:@"iPad7,1"])
+ newDeviceType = @"iPad Pro 12.9 (2nd Gen - WiFi)";
+ else if ([deviceType isEqualToString:@"iPad7,2"])
+ newDeviceType = @"iPad Pro 12.9 (2nd Gen - Cellular)";
+ else if ([deviceType isEqualToString:@"iPad7,3"])
+ newDeviceType = @"iPad Pro 10.5 (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad7,4"])
+ newDeviceType = @"iPad Pro 10.5 (Cellular)";
+ else if ([deviceType isEqualToString:@"iPad7,5"])
+ newDeviceType = @"iPad 6 (WiFi)";
+ else if ([deviceType isEqualToString:@"iPad7,6"])
+ newDeviceType = @"iPad 6 (WiFi+Cellular)";
+ else if ([deviceType isEqualToString:@"iPad8,1"])
+ newDeviceType = @"iPad Pro 11 (3rd Gen - WiFi)";
+ else if ([deviceType isEqualToString:@"iPad8,2"])
+ newDeviceType = @"iPad Pro 11 (3rd Gen - 1TB, WiFi)";
+ else if ([deviceType isEqualToString:@"iPad8,3"])
+ newDeviceType = @"iPad Pro 11 (3rd Gen - WiFi+Cellular)";
+ else if ([deviceType isEqualToString:@"iPad8,4"])
+ newDeviceType = @"iPad Pro 11 (3rd Gen - 1TB, WiFi+Cellular)";
+ else if ([deviceType isEqualToString:@"iPad8,5"])
+ newDeviceType = @"iPad Pro 12.9 (3rd Gen - WiFi)";
+ else if ([deviceType isEqualToString:@"iPad8,6"])
+ newDeviceType = @"iPad Pro 12.9 (3rd Gen - 1TB, WiFi)";
+ else if ([deviceType isEqualToString:@"iPad8,7"])
+ newDeviceType = @"iPad Pro 12.9 (3rd Gen - WiFi+Cellular)";
+ else if ([deviceType isEqualToString:@"iPad8,8"])
+ newDeviceType = @"iPad Pro 12.9 (3rd Gen - 1TB, WiFi+Cellular)";
+ // Catch All iPad
+ else if ([deviceType hasPrefix:@"iPad"])
+ newDeviceType = @"iPad";
+ // Apple TV
+ else if ([deviceType isEqualToString:@"AppleTV2,1"])
+ newDeviceType = @"Apple TV 2";
+ else if ([deviceType isEqualToString:@"AppleTV3,1"])
+ newDeviceType = @"Apple TV 3";
+ else if ([deviceType isEqualToString:@"AppleTV3,2"])
+ newDeviceType = @"Apple TV 3 (2013)";
+
// Return the new device type
- return NewDeviceType;
+ return newDeviceType;
}
@catch (NSException *exception) {
// Error
@@ -248,14 +325,14 @@ + (NSString *)systemDeviceTypeFormatted:(BOOL)formatted {
// Unformatted
@try {
// Set up a struct
- struct utsname DT;
+ struct utsname dt;
// Get the system information
- uname(&DT);
+ uname(&dt);
// Set the device type to the machine type
- DeviceType = [NSString stringWithFormat:@"%s", DT.machine];
-
+ deviceType = [NSString stringWithFormat:@"%s", dt.machine];
+
// Return the device type
- return DeviceType;
+ return deviceType;
}
@catch (NSException *exception) {
// Error
@@ -277,7 +354,7 @@ + (NSInteger)screenWidth {
// Invalid Width
return -1;
}
-
+
// Successful
return Width;
}
@@ -300,7 +377,7 @@ + (NSInteger)screenHeight {
// Invalid Height
return -1;
}
-
+
// Successful
return Height;
}
@@ -321,7 +398,7 @@ + (float)screenBrightness {
// Invalid brightness
return -1;
}
-
+
// Successful
return (brightness * 100);
}
@@ -347,14 +424,18 @@ + (BOOL)multitaskingEnabled {
// Proximity sensor enabled?
+ (BOOL)proximitySensorEnabled {
+ if (![NSThread isMainThread]) {
+ return sCachedIsProximityEnabled;
+ }
+
// Is the proximity sensor enabled?
if ([[UIDevice currentDevice] respondsToSelector:@selector(setProximityMonitoringEnabled:)]) {
// Create a UIDevice variable
UIDevice *device = [UIDevice currentDevice];
-
+
// Make a Bool for the proximity Sensor
BOOL ProximitySensor;
-
+
// Turn the sensor on, if not already on, and see if it works
if (device.proximityMonitoringEnabled != YES) {
// Sensor is off
@@ -374,11 +455,13 @@ + (BOOL)proximitySensorEnabled {
// Sensor is already on
ProximitySensor = true;
}
-
+
// Return on or off
+ sCachedIsProximityEnabled = ProximitySensor;
return ProximitySensor;
} else {
// Doesn't respond to selector
+ sCachedIsProximityEnabled = false;
return false;
}
}
@@ -388,24 +471,28 @@ + (BOOL)debuggerAttached {
// Is the debugger attached?
@try {
// Set up the variables
- size_t size = sizeof(struct kinfo_proc); struct kinfo_proc info;
- int ret = 0, name[4];
- memset(&info, 0, sizeof(struct kinfo_proc));
-
- // Get the process information
- name[0] = CTL_KERN;
- name[1] = KERN_PROC;
- name[2] = KERN_PROC_PID; name[3] = getpid();
-
- // Check to make sure the variables are correct
- if (ret == (sysctl(name, 4, &info, &size, NULL, 0))) {
+ int ret;
+ int mib[4];
+ struct kinfo_proc info;
+ size_t size;
+ info.kp_proc.p_flag = 0;
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = getpid();
+ size = sizeof(info);
+ ret = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
+
+ // Verify ret
+ if (ret) {
// Sysctl() failed
// Return the output of sysctl
return ret;
}
-
- // Return whether or not we're being debugged
- return (info.kp_proc.p_flag & P_TRACED) ? 1 : 0;
+
+ // Return whether the process is being traced or not
+ return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
+
}
@catch (NSException *exception) {
// Error
@@ -438,4 +525,64 @@ + (BOOL)pluggedIn {
}
}
+// Step-Counting Available?
++ (BOOL)stepCountingAvailable {
+ @try {
+ // Make sure the Pedometer class exists
+ if ([CMPedometer class]) {
+ // Make sure the selector exists
+ if ([CMPedometer respondsToSelector:@selector(isStepCountingAvailable)]) {
+ // Return whether it's available
+ return [CMPedometer isStepCountingAvailable];
+ }
+ }
+ // Not available
+ return false;
+ }
+ @catch (NSException *exception) {
+ // Error
+ return false;
+ }
+}
+
+// Distance Available
++ (BOOL)distanceAvailable {
+ @try {
+ // Make sure the Pedometer class exists
+ if ([CMPedometer class]) {
+ // Make sure the selector exists
+ if ([CMPedometer respondsToSelector:@selector(isDistanceAvailable)]) {
+ // Return whether it's available
+ return [CMPedometer isDistanceAvailable];
+ }
+ }
+ // Not available
+ return false;
+ }
+ @catch (NSException *exception) {
+ // Error
+ return false;
+ }
+}
+
+// Floor Counting Available
++ (BOOL)floorCountingAvailable {
+ @try {
+ // Make sure the Pedometer class exists
+ if ([CMPedometer class]) {
+ // Make sure the selector exists
+ if ([CMPedometer respondsToSelector:@selector(isFloorCountingAvailable)]) {
+ // Return whether it's available
+ return [CMPedometer isFloorCountingAvailable];
+ }
+ }
+ // Not available
+ return false;
+ }
+ @catch (NSException *exception) {
+ // Error
+ return false;
+ }
+}
+
@end
diff --git a/System Services/Utilities/SSJailbreakCheck.h b/System Services/Utilities/SSJailbreakCheck.h
index cc5614c..6bc4123 100755
--- a/System Services/Utilities/SSJailbreakCheck.h
+++ b/System Services/Utilities/SSJailbreakCheck.h
@@ -20,9 +20,6 @@
#define PLISTPATH [[NSBundle mainBundle] infoDictionary]
// Jailbreak Check Definitions
-#define CYDIA @"MobileCydia"
-#define OTHERCYDIA @"Cydia"
-#define OOCYDIA @"afpd"
#define CYDIAPACKAGE @"cydia://package/com.fake.package"
#define CYDIALOC @"/Applications/Cydia.app"
#define HIDDENFILES [NSArray arrayWithObjects:@"/Applications/RockApp.app",@"/Applications/Icy.app",@"/usr/sbin/sshd",@"/usr/bin/sshd",@"/usr/libexec/sftp-server",@"/Applications/WinterBoard.app",@"/Applications/SBSettings.app",@"/Applications/MxTube.app",@"/Applications/IntelliScreen.app",@"/Library/MobileSubstrate/DynamicLibraries/Veency.plist",@"/Library/MobileSubstrate/DynamicLibraries/LiveClock.plist",@"/private/var/lib/apt",@"/private/var/stash",@"/System/Library/LaunchDaemons/com.ikey.bbot.plist",@"/System/Library/LaunchDaemons/com.saurik.Cydia.Startup.plist",@"/private/var/tmp/cydia.log",@"/private/var/lib/cydia", @"/etc/clutch.conf", @"/var/cache/clutch.plist", @"/etc/clutch_cracked.plist", @"/var/cache/clutch_cracked.plist", @"/var/lib/clutch/overdrive.dylib", @"/var/root/Documents/Cracked/", nil]
diff --git a/System Services/Utilities/SSJailbreakCheck.m b/System Services/Utilities/SSJailbreakCheck.m
index dc75809..c733613 100755
--- a/System Services/Utilities/SSJailbreakCheck.m
+++ b/System Services/Utilities/SSJailbreakCheck.m
@@ -34,16 +34,6 @@
KFIFC = 47293,
// Failed the plist check
KFPlist = 9412,
- // Failed the Processes Check with Cydia
- KFProcessesCydia = 10012,
- // Failed the Processes Check with other Cydia
- KFProcessesOtherCydia = 42932,
- // Failed the Processes Check with other other Cydia
- KFProcessesOtherOCydia = 10013,
- // Failed the FSTab Check
- KFFSTab = 9620,
- // Failed the System() Check
- KFSystem = 47475,
// Failed the Symbolic Link Check
KFSymbolic = 34859,
// Failed the File Exists Check
@@ -86,27 +76,6 @@ + (int)jailbroken {
motzart += 2;
}
- // Check if iOS 8 or lower
- if (SYSTEM_VERSION_LESS_THAN(@"9.0")) {
- // Processes Check
- if ([self processesCheck] != NOTJAIL) {
- // Jailbroken
- motzart += 2;
- }
-
- // FSTab Check
- if ([self fstabCheck] != NOTJAIL) {
- // Jailbroken
- motzart += 1;
- }
-
- // Shell Check
- if ([self systemCheck] != NOTJAIL) {
- // Jailbroken
- motzart += 2;
- }
- }
-
// Symbolic Link Check
if ([self symbolicLinkCheck] != NOTJAIL) {
// Jailbroken
@@ -136,14 +105,15 @@ + (int)urlCheck {
@try {
#if !(defined(__has_feature) && __has_feature(attribute_availability_app_extension))
// Create a fake url for cydia
- NSURL *FakeURL = [NSURL URLWithString:CYDIAPACKAGE];
+ NSURL *fakeURL = [NSURL URLWithString:CYDIAPACKAGE];
// Return whether or not cydia's openurl item exists
- if ([[UIApplication sharedApplication] canOpenURL:FakeURL])
+ if ([[UIApplication sharedApplication] canOpenURL:fakeURL])
return KFOpenURL;
#endif
}
@catch (NSException *exception) {
// Error, return false
+ return NOTJAIL;
}
return NOTJAIL;
}
@@ -180,11 +150,11 @@ + (int)inaccessibleFilesCheck {
}
}
- // Shouldn't get this far, return jailbroken
+ // No inaccessible files found, return NOT Jailbroken
return NOTJAIL;
}
@catch (NSException *exception) {
- // Error, return false
+ // Error, return NOT Jailbroken
return NOTJAIL;
}
}
@@ -193,10 +163,10 @@ + (int)inaccessibleFilesCheck {
+ (int)plistCheck {
@try {
// Define the Executable name
- NSString *ExeName = EXEPATH;
+ NSString *exeName = EXEPATH;
NSDictionary *ipl = PLISTPATH;
// Check if the plist exists
- if ([FILECHECK ExeName] == FALSE || ipl == nil || ipl.count <= 0) {
+ if ([FILECHECK exeName] == FALSE || ipl == nil || ipl.count <= 0) {
// Executable file can't be found and the plist can't be found...hmmm
return KFPlist;
} else {
@@ -210,74 +180,6 @@ + (int)plistCheck {
}
}
-// Running Processes Check
-+ (int)processesCheck {
- @try {
- // Make a processes array
- NSArray *processes = [self runningProcesses];
-
- // Check for Cydia in the running processes
- for (NSDictionary * dict in processes) {
- // Define the process name
- NSString *process = [dict objectForKey:@"ProcessName"];
- // If the process is this executable
- if ([process isEqualToString:CYDIA]) {
- // Return Jailbroken
- return KFProcessesCydia;
- } else if ([process isEqualToString:OTHERCYDIA]) {
- // Return Jailbroken
- return KFProcessesOtherCydia;
- } else if ([process isEqualToString:OOCYDIA]) {
- // Return Jailbroken
- return KFProcessesOtherOCydia;
- }
- }
-
- // Not Jailbroken
- return NOTJAIL;
- }
- @catch (NSException *exception) {
- // Error
- return NOTJAIL;
- }
-}
-
-// FSTab Size
-+ (int)fstabCheck {
- @try {
- struct stat sb;
- stat("/etc/fstab", &sb);
- long long size = sb.st_size;
- if (size == 80) {
- // Not jailbroken
- return NOTJAIL;
- } else
- // Jailbroken
- return KFFSTab;
- }
- @catch (NSException *exception) {
- // Not jailbroken
- return NOTJAIL;
- }
-}
-
-// System() available
-+ (int)systemCheck {
- @try {
- // See if the system call can be used
- if (system(0)) {
- // Jailbroken
- return KFSystem;
- } else
- // Not Jailbroken
- return NOTJAIL;
- }
- @catch (NSException *exception) {
- // Not Jailbroken
- return NOTJAIL;
- }
-}
-
// Symbolic Link available
+ (int)symbolicLinkCheck {
@try {
diff --git a/System Services/Utilities/SSLocalizationInfo.m b/System Services/Utilities/SSLocalizationInfo.m
index 743eaca..fa1160a 100755
--- a/System Services/Utilities/SSLocalizationInfo.m
+++ b/System Services/Utilities/SSLocalizationInfo.m
@@ -17,16 +17,16 @@ + (NSString *)country {
// Get the user's country
@try {
// Get the locale
- NSLocale *Locale = [NSLocale currentLocale];
+ NSLocale *locale = [NSLocale currentLocale];
// Get the country from the locale
- NSString *Country = [Locale localeIdentifier];
+ NSString *country = [locale localeIdentifier];
// Check for validity
- if (Country == nil || Country.length <= 0) {
+ if (country == nil || country.length <= 0) {
// Error, invalid country
return nil;
}
// Completed Successfully
- return Country;
+ return country;
}
@catch (NSException *exception) {
// Error
@@ -39,16 +39,16 @@ + (NSString *)language {
// Get the user's language
@try {
// Get the list of languages
- NSArray *LanguageArray = [NSLocale preferredLanguages];
+ NSArray *languageArray = [NSLocale preferredLanguages];
// Get the user's language
- NSString *Language = [LanguageArray objectAtIndex:0];
+ NSString *language = [languageArray objectAtIndex:0];
// Check for validity
- if (Language == nil || Language.length <= 0) {
+ if (language == nil || language.length <= 0) {
// Error, invalid language
return nil;
}
// Completed Successfully
- return Language;
+ return language;
}
@catch (NSException *exception) {
// Error
@@ -61,16 +61,16 @@ + (NSString *)timeZone {
// Get the user's timezone
@try {
// Get the system timezone
- NSTimeZone *LocalTime = [NSTimeZone systemTimeZone];
+ NSTimeZone *localTime = [NSTimeZone systemTimeZone];
// Convert the time zone to a string
- NSString *TimeZone = [LocalTime name];
+ NSString *timeZone = [localTime name];
// Check for validity
- if (TimeZone == nil || TimeZone.length <= 0) {
+ if (timeZone == nil || timeZone.length <= 0) {
// Error, invalid TimeZone
return nil;
}
// Completed Successfully
- return TimeZone;
+ return timeZone;
}
@catch (NSException *exception) {
// Error
@@ -83,14 +83,14 @@ + (NSString *)currency {
// Get the user's currency
@try {
// Get the system currency
- NSString *Currency = [[NSLocale currentLocale] objectForKey:NSLocaleCurrencySymbol];
+ NSString *currency = [[NSLocale currentLocale] objectForKey:NSLocaleCurrencySymbol];
// Check for validity
- if (Currency == nil || Currency.length <= 0) {
+ if (currency == nil || currency.length <= 0) {
// Error, invalid Currency
return nil;
}
// Completed Successfully
- return Currency;
+ return currency;
}
@catch (NSException *exception) {
// Error
diff --git a/System Services/Utilities/SSMemoryInfo.m b/System Services/Utilities/SSMemoryInfo.m
index 4b669ae..73bf65e 100755
--- a/System Services/Utilities/SSMemoryInfo.m
+++ b/System Services/Utilities/SSMemoryInfo.m
@@ -21,32 +21,32 @@ + (double)totalMemory {
// Find the total amount of memory
@try {
// Set up the variables
- double TotalMemory = 0.00;
- double AllMemory = [[NSProcessInfo processInfo] physicalMemory];
+ double totalMemory = 0.00;
+ double allMemory = [[NSProcessInfo processInfo] physicalMemory];
// Total Memory (formatted)
- TotalMemory = (AllMemory / 1024.0) / 1024.0;
+ totalMemory = (allMemory / 1024.0) / 1024.0;
// Round to the nearest multiple of 256mb - Almost all RAM is a multiple of 256mb (I do believe)
int toNearest = 256;
- int remainder = (int)TotalMemory % toNearest;
+ int remainder = (int)totalMemory % toNearest;
if (remainder >= toNearest / 2) {
// Round the final number up
- TotalMemory = ((int)TotalMemory - remainder) + 256;
+ totalMemory = ((int)totalMemory - remainder) + 256;
} else {
// Round the final number down
- TotalMemory = (int)TotalMemory - remainder;
+ totalMemory = (int)totalMemory - remainder;
}
// Check to make sure it's valid
- if (TotalMemory <= 0) {
+ if (totalMemory <= 0) {
// Error, invalid memory value
return -1;
}
// Completed Successfully
- return TotalMemory;
+ return totalMemory;
}
@catch (NSException *exception) {
// Error
@@ -59,7 +59,7 @@ + (double)freeMemory:(BOOL)inPercent {
// Find the total amount of free memory
@try {
// Set up the variables
- double TotalMemory = 0.00;
+ double totalMemory = 0.00;
vm_statistics_data_t vmStats;
mach_msg_type_number_t infoCount = HOST_VM_INFO_COUNT;
kern_return_t kernReturn = host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&vmStats, &infoCount);
@@ -72,24 +72,24 @@ + (double)freeMemory:(BOOL)inPercent {
if (inPercent) {
// Percent
// Convert to doubles
- double FM = [self totalMemory];
- double AM = ((vm_page_size * vmStats.free_count) / 1024.0) / 1024.0;
+ double fm = [self totalMemory];
+ double am = ((vm_page_size * vmStats.free_count) / 1024.0) / 1024.0;
// Get the percent
- TotalMemory = (AM * 100) / FM;
+ totalMemory = (am * 100) / fm;
} else {
// Not in percent
// Total Memory (formatted)
- TotalMemory = ((vm_page_size * vmStats.free_count) / 1024.0) / 1024.0;
+ totalMemory = ((vm_page_size * vmStats.free_count) / 1024.0) / 1024.0;
}
// Check to make sure it's valid
- if (TotalMemory <= 0) {
+ if (totalMemory <= 0) {
// Error, invalid memory value
return -1;
}
// Completed Successfully
- return TotalMemory;
+ return totalMemory;
}
@catch (NSException *exception) {
// Error
@@ -102,7 +102,7 @@ + (double)usedMemory:(BOOL)inPercent {
// Find the total amount of used memory
@try {
// Set up the variables
- double TotalUsedMemory = 0.00;
+ double totalUsedMemory = 0.00;
mach_port_t host_port;
mach_msg_type_number_t host_size;
vm_size_t pagesize;
@@ -121,33 +121,33 @@ + (double)usedMemory:(BOOL)inPercent {
}
// Memory statistics in bytes
- natural_t UsedMemory = (natural_t)((vm_stat.active_count +
+ natural_t usedMemory = (natural_t)((vm_stat.active_count +
vm_stat.inactive_count +
vm_stat.wire_count) * pagesize);
- natural_t AllMemory = [self totalMemory];
+ natural_t allMemory = [self totalMemory];
// Check if the user wants it in percent
if (inPercent) {
// Percent
// Convert to doubles
- double UM = (UsedMemory /1024) / 1024;
- double AM = AllMemory;
+ double um = (usedMemory /1024) / 1024;
+ double am = allMemory;
// Get the percent
- TotalUsedMemory = (UM * 100) / AM;
+ totalUsedMemory = (um * 100) / am;
} else {
// Not in percent
// Total Used Memory (formatted)
- TotalUsedMemory = (UsedMemory / 1024.0) / 1024.0;
+ totalUsedMemory = (usedMemory / 1024.0) / 1024.0;
}
// Check to make sure it's valid
- if (TotalUsedMemory <= 0) {
+ if (totalUsedMemory <= 0) {
// Error, invalid memory value
return -1;
}
// Completed Successfully
- return TotalUsedMemory;
+ return totalUsedMemory;
}
@catch (NSException *exception) {
// Error
@@ -160,7 +160,7 @@ + (double)activeMemory:(BOOL)inPercent {
// Find the Active memory
@try {
// Set up the variables
- double TotalMemory = 0.00;
+ double totalMemory = 0.00;
mach_port_t host_port;
mach_msg_type_number_t host_size;
vm_size_t pagesize;
@@ -185,21 +185,21 @@ + (double)activeMemory:(BOOL)inPercent {
double FM = [self totalMemory];
double AM = ((vm_stat.active_count * pagesize) / 1024.0) / 1024.0;
// Get the percent
- TotalMemory = (AM * 100) / FM;
+ totalMemory = (AM * 100) / FM;
} else {
// Not in percent
// Total Memory (formatted)
- TotalMemory = ((vm_stat.active_count * pagesize) / 1024.0) / 1024.0;
+ totalMemory = ((vm_stat.active_count * pagesize) / 1024.0) / 1024.0;
}
// Check to make sure it's valid
- if (TotalMemory <= 0) {
+ if (totalMemory <= 0) {
// Error, invalid memory value
return -1;
}
// Completed Successfully
- return TotalMemory;
+ return totalMemory;
}
@catch (NSException *exception) {
// Error
@@ -212,7 +212,7 @@ + (double)inactiveMemory:(BOOL)inPercent {
// Find the Inactive memory
@try {
// Set up the variables
- double TotalMemory = 0.00;
+ double totalMemory = 0.00;
mach_port_t host_port;
mach_msg_type_number_t host_size;
vm_size_t pagesize;
@@ -237,21 +237,21 @@ + (double)inactiveMemory:(BOOL)inPercent {
double FM = [self totalMemory];
double AM = ((vm_stat.inactive_count * pagesize) / 1024.0) / 1024.0;
// Get the percent
- TotalMemory = (AM * 100) / FM;
+ totalMemory = (AM * 100) / FM;
} else {
// Not in percent
// Total Memory (formatted)
- TotalMemory = ((vm_stat.inactive_count * pagesize) / 1024.0) / 1024.0;
+ totalMemory = ((vm_stat.inactive_count * pagesize) / 1024.0) / 1024.0;
}
// Check to make sure it's valid
- if (TotalMemory <= 0) {
+ if (totalMemory <= 0) {
// Error, invalid memory value
return -1;
}
// Completed Successfully
- return TotalMemory;
+ return totalMemory;
}
@catch (NSException *exception) {
// Error
@@ -264,7 +264,7 @@ + (double)wiredMemory:(BOOL)inPercent {
// Find the Wired memory
@try {
// Set up the variables
- double TotalMemory = 0.00;
+ double totalMemory = 0.00;
mach_port_t host_port;
mach_msg_type_number_t host_size;
vm_size_t pagesize;
@@ -289,21 +289,21 @@ + (double)wiredMemory:(BOOL)inPercent {
double FM = [self totalMemory];
double AM = ((vm_stat.wire_count * pagesize) / 1024.0) / 1024.0;
// Get the percent
- TotalMemory = (AM * 100) / FM;
+ totalMemory = (AM * 100) / FM;
} else {
// Not in percent
// Total Memory (formatted)
- TotalMemory = ((vm_stat.wire_count * pagesize) / 1024.0) / 1024.0;
+ totalMemory = ((vm_stat.wire_count * pagesize) / 1024.0) / 1024.0;
}
// Check to make sure it's valid
- if (TotalMemory <= 0) {
+ if (totalMemory <= 0) {
// Error, invalid memory value
return -1;
}
// Completed Successfully
- return TotalMemory;
+ return totalMemory;
}
@catch (NSException *exception) {
// Error
@@ -316,7 +316,7 @@ + (double)purgableMemory:(BOOL)inPercent {
// Find the Purgable memory
@try {
// Set up the variables
- double TotalMemory = 0.00;
+ double totalMemory = 0.00;
mach_port_t host_port;
mach_msg_type_number_t host_size;
vm_size_t pagesize;
@@ -338,24 +338,24 @@ + (double)purgableMemory:(BOOL)inPercent {
if (inPercent) {
// Percent
// Convert to doubles
- double FM = [self totalMemory];
- double AM = ((vm_stat.purgeable_count * pagesize) / 1024.0) / 1024.0;
+ double fm = [self totalMemory];
+ double am = ((vm_stat.purgeable_count * pagesize) / 1024.0) / 1024.0;
// Get the percent
- TotalMemory = (AM * 100) / FM;
+ totalMemory = (am * 100) / fm;
} else {
// Not in percent
// Total Memory (formatted)
- TotalMemory = ((vm_stat.purgeable_count * pagesize) / 1024.0) / 1024.0;
+ totalMemory = ((vm_stat.purgeable_count * pagesize) / 1024.0) / 1024.0;
}
// Check to make sure it's valid
- if (TotalMemory <= 0) {
+ if (totalMemory <= 0) {
// Error, invalid memory value
return -1;
}
// Completed Successfully
- return TotalMemory;
+ return totalMemory;
}
@catch (NSException *exception) {
// Error
diff --git a/System Services/Utilities/SSNetworkInfo.h b/System Services/Utilities/SSNetworkInfo.h
index 9d50c64..b768060 100755
--- a/System Services/Utilities/SSNetworkInfo.h
+++ b/System Services/Utilities/SSNetworkInfo.h
@@ -15,9 +15,6 @@
// Get Current IP Address
+ (nullable NSString *)currentIPAddress;
-// Get Current MAC Address
-+ (nullable NSString *)currentMACAddress;
-
// Get the External IP Address
+ (nullable NSString *)externalIPAddress;
@@ -27,9 +24,6 @@
// Get Cell IPv6 Address
+ (nullable NSString *)cellIPv6Address;
-// Get Cell MAC Address
-+ (nullable NSString *)cellMACAddress;
-
// Get Cell Netmask Address
+ (nullable NSString *)cellNetmaskAddress;
@@ -42,9 +36,6 @@
// Get WiFi IPv6 Address
+ (nullable NSString *)wiFiIPv6Address;
-// Get WiFi MAC Address
-+ (nullable NSString *)wiFiMACAddress;
-
// Get WiFi Netmask Address
+ (nullable NSString *)wiFiNetmaskAddress;
diff --git a/System Services/Utilities/SSNetworkInfo.m b/System Services/Utilities/SSNetworkInfo.m
index 8b36051..7652916 100755
--- a/System Services/Utilities/SSNetworkInfo.m
+++ b/System Services/Utilities/SSNetworkInfo.m
@@ -15,11 +15,7 @@
#import
// route
-#if TARGET_IPHONE_SIMULATOR
-#include
-#else
#include "route.h"
-#endif
// sysctl
#import
@@ -247,69 +243,30 @@ + (nullable NSString *)currentIPAddress {
// WiFi is in use
// Get the WiFi IP Address
- NSString *WiFiAddress = [self wiFiIPAddress];
+ NSString *wiFiAddress = [self wiFiIPAddress];
// Check that you get something back
- if (WiFiAddress == nil || WiFiAddress.length <= 0) {
+ if (wiFiAddress == nil || wiFiAddress.length <= 0) {
// Error, no address found
return nil;
}
// Return Wifi address
- return WiFiAddress;
+ return wiFiAddress;
} else if ([self connectedToCellNetwork]) {
// Cell Network is in use
// Get the Cell IP Address
- NSString *CellAddress = [self cellIPAddress];
+ NSString *cellAddress = [self cellIPAddress];
// Check that you get something back
- if (CellAddress == nil || CellAddress.length <= 0) {
+ if (cellAddress == nil || cellAddress.length <= 0) {
// Error, no address found
return nil;
}
// Return Cell address
- return CellAddress;
- } else {
- // No interface in use
- return nil;
- }
-}
-
-// Get Current MAC Address
-+ (nullable NSString *)currentMACAddress {
- // Get the current interface MAC Address
-
- // Check which interface is currently in use
- if ([self connectedToWiFi]) {
- // WiFi is in use
-
- // Get the WiFi MAC Address
- NSString *WiFiAddress = [self wiFiMACAddress];
-
- // Check that you get something back
- if (WiFiAddress == nil || WiFiAddress.length <= 0) {
- // Error, no address found
- return nil;
- }
-
- // Return Wifi address
- return WiFiAddress;
- } else if ([self connectedToCellNetwork]) {
- // Cell Network is in use
-
- // Get the Cell MAC Address
- NSString *CellAddress = [self cellMACAddress];
-
- // Check that you get something back
- if (CellAddress == nil || CellAddress.length <= 0) {
- // Error, no address found
- return nil;
- }
-
- // Return Cell address
- return CellAddress;
+ return cellAddress;
} else {
// No interface in use
return nil;
@@ -325,38 +282,16 @@ + (nullable NSString *)externalIPAddress {
return nil;
}
- // Get the external IP Address based on dynsns.org
+ // Get the external IP Address based on icanhazip.com
NSError *error = nil;
- NSString *theIpHtml = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.dyndns.org/cgi-bin/check_ip.cgi"]
- encoding:NSUTF8StringEncoding
- error:&error];
+
+ // Using https://icanhazip.com
+ NSString *externalIP = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"https://icanhazip.com/"] encoding:NSUTF8StringEncoding error:&error];
+
if (!error) {
- NSUInteger an_Integer;
- NSArray * ipItemsArray;
- NSString *externalIP;
- NSScanner *theScanner;
- NSString *text = nil;
- theScanner = [NSScanner scannerWithString:theIpHtml];
-
- while ([theScanner isAtEnd] == NO) {
-
- // find start of tag
- [theScanner scanUpToString:@"<" intoString:NULL] ;
-
- // find end of tag
- [theScanner scanUpToString:@">" intoString:&text] ;
-
- // replace the found tag with a space
- //(you can filter multi-spaces out later if you wish)
- theIpHtml = [theIpHtml stringByReplacingOccurrencesOfString:
- [ NSString stringWithFormat:@"%@>", text]
- withString:@" "] ;
- ipItemsArray = [theIpHtml componentsSeparatedByString:@" "];
- an_Integer = [ipItemsArray indexOfObject:@"Address:"];
-
- externalIP =[ipItemsArray objectAtIndex:++an_Integer];
- }
+ // Format the IP Address
+ externalIP = [externalIP stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];
// Check that you get something back
if (externalIP == nil || externalIP.length <= 0) {
@@ -382,56 +317,56 @@ + (nullable NSString *)cellIPAddress {
// Get the Cell IP Address
@try {
// Set a string for the address
- NSString *IPAddress;
+ NSString *ipAddress;
// Set up structs to hold the interfaces and the temporary address
- struct ifaddrs *Interfaces;
- struct ifaddrs *Temp;
+ struct ifaddrs *interfaces;
+ struct ifaddrs *temp;
struct sockaddr_in *s4;
char buf[64];
// If it's 0, then it's good
- if (!getifaddrs(&Interfaces))
+ if (!getifaddrs(&interfaces))
{
// Loop through the list of interfaces
- Temp = Interfaces;
+ temp = interfaces;
// Run through it while it's still available
- while(Temp != NULL)
+ while(temp != NULL)
{
// If the temp interface is a valid interface
- if(Temp->ifa_addr->sa_family == AF_INET)
+ if(temp->ifa_addr->sa_family == AF_INET)
{
// Check if the interface is Cell
- if([[NSString stringWithUTF8String:Temp->ifa_name] isEqualToString:@"pdp_ip0"])
+ if([[NSString stringWithUTF8String:temp->ifa_name] isEqualToString:@"pdp_ip0"])
{
- s4 = (struct sockaddr_in *)Temp->ifa_addr;
+ s4 = (struct sockaddr_in *)temp->ifa_addr;
- if (inet_ntop(Temp->ifa_addr->sa_family, (void *)&(s4->sin_addr), buf, sizeof(buf)) == NULL) {
+ if (inet_ntop(temp->ifa_addr->sa_family, (void *)&(s4->sin_addr), buf, sizeof(buf)) == NULL) {
// Failed to find it
- IPAddress = nil;
+ ipAddress = nil;
} else {
// Got the Cell IP Address
- IPAddress = [NSString stringWithUTF8String:buf];
+ ipAddress = [NSString stringWithUTF8String:buf];
}
}
}
// Set the temp value to the next interface
- Temp = Temp->ifa_next;
+ temp = temp->ifa_next;
}
}
// Free the memory of the interfaces
- freeifaddrs(Interfaces);
+ freeifaddrs(interfaces);
// Check to make sure it's not empty
- if (IPAddress == nil || IPAddress.length <= 0) {
+ if (ipAddress == nil || ipAddress.length <= 0) {
// Empty, return not found
return nil;
}
// Return the IP Address of the WiFi
- return IPAddress;
+ return ipAddress;
}
@catch (NSException *exception) {
// Error, IP Not found
@@ -444,56 +379,56 @@ + (nullable NSString *)cellIPv6Address {
// Get the Cell IP Address
@try {
// Set a string for the address
- NSString *IPAddress;
+ NSString *ipAddress;
// Set up structs to hold the interfaces and the temporary address
- struct ifaddrs *Interfaces;
- struct ifaddrs *Temp;
+ struct ifaddrs *interfaces;
+ struct ifaddrs *temp;
struct sockaddr_in6 *s6;
char buf[INET6_ADDRSTRLEN];
// If it's 0, then it's good
- if (!getifaddrs(&Interfaces))
+ if (!getifaddrs(&interfaces))
{
// Loop through the list of interfaces
- Temp = Interfaces;
+ temp = interfaces;
// Run through it while it's still available
- while(Temp != NULL)
+ while(temp != NULL)
{
// If the temp interface is a valid interface
- if(Temp->ifa_addr->sa_family == AF_INET6)
+ if(temp->ifa_addr->sa_family == AF_INET6)
{
// Check if the interface is Cell
- if([[NSString stringWithUTF8String:Temp->ifa_name] isEqualToString:@"pdp_ip0"])
+ if([[NSString stringWithUTF8String:temp->ifa_name] isEqualToString:@"pdp_ip0"])
{
- s6 = (struct sockaddr_in6 *)Temp->ifa_addr;
+ s6 = (struct sockaddr_in6 *)temp->ifa_addr;
if (inet_ntop(AF_INET6, (void *)&(s6->sin6_addr), buf, sizeof(buf)) == NULL) {
// Failed to find it
- IPAddress = nil;
+ ipAddress = nil;
} else {
// Got the Cell IP Address
- IPAddress = [NSString stringWithUTF8String:buf];
+ ipAddress = [NSString stringWithUTF8String:buf];
}
}
}
// Set the temp value to the next interface
- Temp = Temp->ifa_next;
+ temp = temp->ifa_next;
}
}
// Free the memory of the interfaces
- freeifaddrs(Interfaces);
+ freeifaddrs(interfaces);
// Check to make sure it's not empty
- if (IPAddress == nil || IPAddress.length <= 0) {
+ if (ipAddress == nil || ipAddress.length <= 0) {
// Empty, return not found
return nil;
}
// Return the IP Address of the WiFi
- return IPAddress;
+ return ipAddress;
}
@catch (NSException *exception) {
// Error, IP Not found
@@ -501,86 +436,6 @@ + (nullable NSString *)cellIPv6Address {
}
}
-// Get Cell MAC Address
-+ (nullable NSString *)cellMACAddress {
- // Get the Cell MAC Address
- @try {
- // Start by setting the variables to get the Cell Mac Address
- int mgmtInfoBase[6];
- char *msgBuffer = NULL;
- size_t length;
- unsigned char macAddress[6];
- struct if_msghdr *interfaceMsgStruct;
- struct sockaddr_dl *socketStruct;
-
- // Setup the management Information Base (mib)
- mgmtInfoBase[0] = CTL_NET; // Request network subsystem
- mgmtInfoBase[1] = AF_ROUTE; // Routing table info
- mgmtInfoBase[2] = 0;
- mgmtInfoBase[3] = AF_LINK; // Request link layer information
- mgmtInfoBase[4] = NET_RT_IFLIST; // Request all configured interfaces
-
- // With all configured interfaces requested, get handle index
- if ((mgmtInfoBase[5] = if_nametoindex([@"pdp_ip0" UTF8String])) == 0)
- // Error, Name to index failure
- return nil;
- else
- {
- // Get the size of the data available (store in len)
- if (sysctl(mgmtInfoBase, 6, NULL, &length, NULL, 0) < 0)
- // Error, Sysctl MgmtInfoBase Failure
- return nil;
- else
- {
- // Alloc memory based on above call
- if ((msgBuffer = malloc(length)) == NULL)
- // Error, Buffer allocation failure
- return nil;
- else
- {
- // Get system information, store in buffer
- if (sysctl(mgmtInfoBase, 6, msgBuffer, &length, NULL, 0) < 0)
- // Error, Sysctl MsgBuffer Failure
- return nil;
- }
- }
- }
-
- // Map msgbuffer to interface message structure
- interfaceMsgStruct = (struct if_msghdr *) msgBuffer;
-
- // Map to link-level socket structure
- socketStruct = (struct sockaddr_dl *) (interfaceMsgStruct + 1);
-
- // Copy link layer address data in socket structure to an array
- memcpy(&macAddress, socketStruct->sdl_data + socketStruct->sdl_nlen, 6);
-
- // Read from char array into a string object, into traditional Mac address format
- NSString *macAddressString = [NSString stringWithFormat:@"%02X:%02X:%02X:%02X:%02X:%02X",
- macAddress[0], macAddress[1], macAddress[2],
- macAddress[3], macAddress[4], macAddress[5]];
-
- // Release the buffer memory
- free(msgBuffer);
-
- // Make a new string from the macAddressString
- NSString *deviceID = macAddressString;
-
- // If the device ID comes back empty
- if (deviceID == (id)[NSNull null] || deviceID.length <= 0) {
- // Return that the MAC address was not found
- return nil;
- }
-
- // Return Successful
- return deviceID;
- }
- @catch (NSException *exception) {
- // Error, return nil
- return nil;
- }
-}
-
// Get Cell Netmask Address
+ (nullable NSString *)cellNetmaskAddress {
// Get the Cell Netmask Address
@@ -636,55 +491,55 @@ + (nullable NSString *)cellBroadcastAddress {
// Get the Cell Broadcast Address
@try {
// Set up strings for the IP and Netmask
- NSString *IPAddress = [self cellIPAddress];
- NSString *NMAddress = [self cellNetmaskAddress];
+ NSString *ipAddress = [self cellIPAddress];
+ NSString *nmAddress = [self cellNetmaskAddress];
// Check to make sure they aren't nil
- if (IPAddress == nil || IPAddress.length <= 0) {
+ if (ipAddress == nil || ipAddress.length <= 0) {
// Error, IP Address can't be nil
return nil;
}
- if (NMAddress == nil || NMAddress.length <= 0) {
+ if (nmAddress == nil || nmAddress.length <= 0) {
// Error, NM Address can't be nil
return nil;
}
// Check the formatting of the IP and NM Addresses
- NSArray *IPCheck = [IPAddress componentsSeparatedByString:@"."];
- NSArray *NMCheck = [NMAddress componentsSeparatedByString:@"."];
+ NSArray *ipCheck = [ipAddress componentsSeparatedByString:@"."];
+ NSArray *nmCheck = [nmAddress componentsSeparatedByString:@"."];
// Make sure the IP and NM Addresses are correct
- if (IPCheck.count != 4 || NMCheck.count != 4) {
+ if (ipCheck.count != 4 || nmCheck.count != 4) {
// Incorrect IP Addresses
return nil;
}
// Set up the variables
- NSUInteger IP = 0;
- NSUInteger NM = 0;
- NSUInteger CS = 24;
+ NSUInteger ip = 0;
+ NSUInteger nm = 0;
+ NSUInteger cs = 24;
// Make the address based on the other addresses
- for (NSUInteger i = 0; i < 4; i++, CS -= 8) {
- IP |= [[IPCheck objectAtIndex:i] intValue] << CS;
- NM |= [[NMCheck objectAtIndex:i] intValue] << CS;
+ for (NSUInteger i = 0; i < 4; i++, cs -= 8) {
+ ip |= [[ipCheck objectAtIndex:i] intValue] << cs;
+ nm |= [[nmCheck objectAtIndex:i] intValue] << cs;
}
// Set it equal to the formatted raw addresses
- NSUInteger BA = ~NM | IP;
+ NSUInteger ba = ~nm | ip;
// Make a string for the address
- NSString *BroadcastAddress = [NSString stringWithFormat:@"%ld.%ld.%ld.%ld", (BA & 0xFF000000) >> 24,
- (BA & 0x00FF0000) >> 16, (BA & 0x0000FF00) >> 8, BA & 0x000000FF];
+ NSString *broadcastAddress = [NSString stringWithFormat:@"%ld.%ld.%ld.%ld", (long)(ba & 0xFF000000) >> 24,
+ (long)(ba & 0x00FF0000) >> 16, (long)(ba & 0x0000FF00) >> 8, (long)(ba & 0x000000FF)];
// Check to make sure the string is valid
- if (BroadcastAddress == nil || BroadcastAddress.length <= 0) {
+ if (broadcastAddress == nil || broadcastAddress.length <= 0) {
// Error, no address
return nil;
}
// Return Successful
- return BroadcastAddress;
+ return broadcastAddress;
}
@catch (NSException *exception) {
// Error
@@ -697,52 +552,52 @@ + (nullable NSString *)wiFiIPAddress {
// Get the WiFi IP Address
@try {
// Set a string for the address
- NSString *IPAddress;
+ NSString *ipAddress;
// Set up structs to hold the interfaces and the temporary address
- struct ifaddrs *Interfaces;
- struct ifaddrs *Temp;
+ struct ifaddrs *interfaces;
+ struct ifaddrs *temp;
// Set up int for success or fail
int Status = 0;
// Get all the network interfaces
- Status = getifaddrs(&Interfaces);
+ Status = getifaddrs(&interfaces);
// If it's 0, then it's good
if (Status == 0)
{
// Loop through the list of interfaces
- Temp = Interfaces;
+ temp = interfaces;
// Run through it while it's still available
- while(Temp != NULL)
+ while(temp != NULL)
{
// If the temp interface is a valid interface
- if(Temp->ifa_addr->sa_family == AF_INET)
+ if(temp->ifa_addr->sa_family == AF_INET)
{
// Check if the interface is WiFi
- if([[NSString stringWithUTF8String:Temp->ifa_name] isEqualToString:@"en0"])
+ if([[NSString stringWithUTF8String:temp->ifa_name] isEqualToString:@"en0"])
{
// Get the WiFi IP Address
- IPAddress = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)Temp->ifa_addr)->sin_addr)];
+ ipAddress = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp->ifa_addr)->sin_addr)];
}
}
// Set the temp value to the next interface
- Temp = Temp->ifa_next;
+ temp = temp->ifa_next;
}
}
// Free the memory of the interfaces
- freeifaddrs(Interfaces);
+ freeifaddrs(interfaces);
// Check to make sure it's not empty
- if (IPAddress == nil || IPAddress.length <= 0) {
+ if (ipAddress == nil || ipAddress.length <= 0) {
// Empty, return not found
return nil;
}
// Return the IP Address of the WiFi
- return IPAddress;
+ return ipAddress;
}
@catch (NSException *exception) {
// Error, IP Not found
@@ -755,60 +610,60 @@ + (nullable NSString *)wiFiIPv6Address {
// Get the WiFi IP Address
@try {
// Set a string for the address
- NSString *IPAddress;
+ NSString *ipAddress;
// Set up structs to hold the interfaces and the temporary address
- struct ifaddrs *Interfaces;
- struct ifaddrs *Temp;
+ struct ifaddrs *interfaces;
+ struct ifaddrs *temp;
// Set up int for success or fail
- int Status = 0;
+ int status = 0;
// Get all the network interfaces
- Status = getifaddrs(&Interfaces);
+ status = getifaddrs(&interfaces);
// If it's 0, then it's good
- if (Status == 0)
+ if (status == 0)
{
// Loop through the list of interfaces
- Temp = Interfaces;
+ temp = interfaces;
// Run through it while it's still available
- while(Temp != NULL)
+ while(temp != NULL)
{
// If the temp interface is a valid interface
- if(Temp->ifa_addr->sa_family == AF_INET6)
+ if(temp->ifa_addr->sa_family == AF_INET6)
{
// Check if the interface is WiFi
- if([[NSString stringWithUTF8String:Temp->ifa_name] isEqualToString:@"en0"])
+ if([[NSString stringWithUTF8String:temp->ifa_name] isEqualToString:@"en0"])
{
// Get the WiFi IP Address
- struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)Temp->ifa_addr;
+ struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)temp->ifa_addr;
char buf[INET6_ADDRSTRLEN];
if (inet_ntop(AF_INET6, (void *)&(addr6->sin6_addr), buf, sizeof(buf)) == NULL) {
// Failed to find it
- IPAddress = nil;
+ ipAddress = nil;
} else {
// Got the Cell IP Address
- IPAddress = [NSString stringWithUTF8String:buf];
+ ipAddress = [NSString stringWithUTF8String:buf];
}
}
}
// Set the temp value to the next interface
- Temp = Temp->ifa_next;
+ temp = temp->ifa_next;
}
}
// Free the memory of the interfaces
- freeifaddrs(Interfaces);
+ freeifaddrs(interfaces);
// Check to make sure it's not empty
- if (IPAddress == nil || IPAddress.length <= 0) {
+ if (ipAddress == nil || ipAddress.length <= 0) {
// Empty, return not found
return nil;
}
// Return the IP Address of the WiFi
- return IPAddress;
+ return ipAddress;
}
@catch (NSException *exception) {
// Error, IP Not found
@@ -816,86 +671,6 @@ + (nullable NSString *)wiFiIPv6Address {
}
}
-// Get WiFi MAC Address
-+ (nullable NSString *)wiFiMACAddress {
- // Get the WiFi MAC Address
- @try {
- // Start by setting the variables to get the WiFi Mac Address
- int mgmtInfoBase[6];
- char *msgBuffer = NULL;
- size_t length;
- unsigned char macAddress[6];
- struct if_msghdr *interfaceMsgStruct;
- struct sockaddr_dl *socketStruct;
-
- // Setup the management Information Base (mib)
- mgmtInfoBase[0] = CTL_NET; // Request network subsystem
- mgmtInfoBase[1] = AF_ROUTE; // Routing table info
- mgmtInfoBase[2] = 0;
- mgmtInfoBase[3] = AF_LINK; // Request link layer information
- mgmtInfoBase[4] = NET_RT_IFLIST; // Request all configured interfaces
-
- // With all configured interfaces requested, get handle index
- if ((mgmtInfoBase[5] = if_nametoindex([@"en0" UTF8String])) == 0)
- // Error, Name to index failure
- return nil;
- else
- {
- // Get the size of the data available (store in len)
- if (sysctl(mgmtInfoBase, 6, NULL, &length, NULL, 0) < 0)
- // Error, Sysctl MgmtInfoBase Failure
- return nil;
- else
- {
- // Alloc memory based on above call
- if ((msgBuffer = malloc(length)) == NULL)
- // Error, Buffer allocation failure
- return nil;
- else
- {
- // Get system information, store in buffer
- if (sysctl(mgmtInfoBase, 6, msgBuffer, &length, NULL, 0) < 0)
- // Error, Sysctl MsgBuffer Failure
- return nil;
- }
- }
- }
-
- // Map msgbuffer to interface message structure
- interfaceMsgStruct = (struct if_msghdr *) msgBuffer;
-
- // Map to link-level socket structure
- socketStruct = (struct sockaddr_dl *) (interfaceMsgStruct + 1);
-
- // Copy link layer address data in socket structure to an array
- memcpy(&macAddress, socketStruct->sdl_data + socketStruct->sdl_nlen, 6);
-
- // Read from char array into a string object, into traditional Mac address format
- NSString *macAddressString = [NSString stringWithFormat:@"%02X:%02X:%02X:%02X:%02X:%02X",
- macAddress[0], macAddress[1], macAddress[2],
- macAddress[3], macAddress[4], macAddress[5]];
-
- // Release the buffer memory
- free(msgBuffer);
-
- // Make a new string from the macAddressString
- NSString *deviceID = macAddressString;
-
- // If the device ID comes back empty
- if (deviceID == (id)[NSNull null] || deviceID.length <= 0) {
- // Return that the MAC address was not found
- return nil;
- }
-
- // Return Successful
- return deviceID;
- }
- @catch (NSException *exception) {
- // Error, return nil
- return nil;
- }
-}
-
// Get WiFi Netmask Address
+ (nullable NSString *)wiFiNetmaskAddress {
// Get the WiFi Netmask Address
@@ -929,16 +704,16 @@ + (nullable NSString *)wiFiNetmaskAddress {
char *netstring = inet_ntoa(((struct sockaddr_in *)&afr.ifr_addr)->sin_addr);
// Create a string for the netmask
- NSString *Netmask = [NSString stringWithUTF8String:netstring];
+ NSString *netmask = [NSString stringWithUTF8String:netstring];
// Check to make sure it's not nil
- if (Netmask == nil || Netmask.length <= 0) {
+ if (netmask == nil || netmask.length <= 0) {
// Error, netmask not found
return nil;
}
// Return successful
- return Netmask;
+ return netmask;
}
@catch (NSException *exception) {
// Error
@@ -951,55 +726,55 @@ + (nullable NSString *)wiFiBroadcastAddress {
// Get the WiFi Broadcast Address
@try {
// Set up strings for the IP and Netmask
- NSString *IPAddress = [self wiFiIPAddress];
- NSString *NMAddress = [self wiFiNetmaskAddress];
+ NSString *ipAddress = [self wiFiIPAddress];
+ NSString *nmAddress = [self wiFiNetmaskAddress];
// Check to make sure they aren't nil
- if (IPAddress == nil || IPAddress.length <= 0) {
+ if (ipAddress == nil || ipAddress.length <= 0) {
// Error, IP Address can't be nil
return nil;
}
- if (NMAddress == nil || NMAddress.length <= 0) {
+ if (nmAddress == nil || nmAddress.length <= 0) {
// Error, NM Address can't be nil
return nil;
}
// Check the formatting of the IP and NM Addresses
- NSArray *IPCheck = [IPAddress componentsSeparatedByString:@"."];
- NSArray *NMCheck = [NMAddress componentsSeparatedByString:@"."];
+ NSArray *ipCheck = [ipAddress componentsSeparatedByString:@"."];
+ NSArray *nmCheck = [nmAddress componentsSeparatedByString:@"."];
// Make sure the IP and NM Addresses are correct
- if (IPCheck.count != 4 || NMCheck.count != 4) {
+ if (ipCheck.count != 4 || nmCheck.count != 4) {
// Incorrect IP Addresses
return nil;
}
// Set up the variables
- NSUInteger IP = 0;
- NSUInteger NM = 0;
- NSUInteger CS = 24;
+ NSUInteger ip = 0;
+ NSUInteger nm = 0;
+ NSUInteger cs = 24;
// Make the address based on the other addresses
- for (NSUInteger i = 0; i < 4; i++, CS -= 8) {
- IP |= [[IPCheck objectAtIndex:i] intValue] << CS;
- NM |= [[NMCheck objectAtIndex:i] intValue] << CS;
+ for (NSUInteger i = 0; i < 4; i++, cs -= 8) {
+ ip |= [[ipCheck objectAtIndex:i] intValue] << cs;
+ nm |= [[nmCheck objectAtIndex:i] intValue] << cs;
}
// Set it equal to the formatted raw addresses
- NSUInteger BA = ~NM | IP;
+ NSUInteger ba = ~nm | ip;
// Make a string for the address
- NSString *BroadcastAddress = [NSString stringWithFormat:@"%lu.%lu.%lu.%lu", (BA & 0xFF000000) >> 24,
- (BA & 0x00FF0000) >> 16, (BA & 0x0000FF00) >> 8, BA & 0x000000FF];
+ NSString *broadcastAddress = [NSString stringWithFormat:@"%lu.%lu.%lu.%lu", (long)(ba & 0xFF000000) >> 24,
+ (long)(ba & 0x00FF0000) >> 16, (long)(ba & 0x0000FF00) >> 8, (long)(ba & 0x000000FF)];
// Check to make sure the string is valid
- if (BroadcastAddress == nil || BroadcastAddress.length <= 0) {
+ if (broadcastAddress == nil || broadcastAddress.length <= 0) {
// Error, no address
return nil;
}
// Return Successful
- return BroadcastAddress;
+ return broadcastAddress;
}
@catch (NSException *exception) {
// Error
@@ -1010,9 +785,9 @@ + (nullable NSString *)wiFiBroadcastAddress {
// Connected to WiFi?
+ (BOOL)connectedToWiFi {
// Check if we're connected to WiFi
- NSString *WiFiAddress = [self wiFiIPAddress];
+ NSString *wiFiAddress = [self wiFiIPAddress];
// Check if the string is populated
- if (WiFiAddress == nil || WiFiAddress.length <= 0) {
+ if (wiFiAddress == nil || wiFiAddress.length <= 0) {
// Nothing found
return false;
} else {
@@ -1024,9 +799,9 @@ + (BOOL)connectedToWiFi {
// Connected to Cellular Network?
+ (BOOL)connectedToCellNetwork {
// Check if we're connected to cell network
- NSString *CellAddress = [self cellIPAddress];
+ NSString *cellAddress = [self cellIPAddress];
// Check if the string is populated
- if (CellAddress == nil || CellAddress.length <= 0) {
+ if (cellAddress == nil || cellAddress.length <= 0) {
// Nothing found
return false;
} else {
diff --git a/System Services/Utilities/SSProcessInfo.h b/System Services/Utilities/SSProcessInfo.h
index 1db5878..8dc696d 100755
--- a/System Services/Utilities/SSProcessInfo.h
+++ b/System Services/Utilities/SSProcessInfo.h
@@ -8,7 +8,6 @@
#import
-NS_CLASS_DEPRECATED_IOS(2_0, 9_0, "SSProcessInfo is deprecated. Process information is no longer allowed in iOS 9")
@interface SSProcessInfo : NSObject
// Process Information
@@ -16,19 +15,4 @@ NS_CLASS_DEPRECATED_IOS(2_0, 9_0, "SSProcessInfo is deprecated. Process informat
// Process ID
+ (int)processID;
-// Process Name
-+ (nullable NSString *)processName;
-
-// Process Status
-+ (int)processStatus;
-
-// Parent Process ID
-+ (int)parentPID;
-
-// Parent ID for a certain PID
-+ (int)parentPIDForProcess:(int)pid;
-
-// List of process information including PID's, Names, PPID's, and Status'
-+ (nullable NSMutableArray *)processesInformation;
-
@end
diff --git a/System Services/Utilities/SSProcessInfo.m b/System Services/Utilities/SSProcessInfo.m
index d3b8a92..cde82de 100755
--- a/System Services/Utilities/SSProcessInfo.m
+++ b/System Services/Utilities/SSProcessInfo.m
@@ -20,14 +20,14 @@ + (int)processID {
// Get the Process ID
@try {
// Get the PID
- int PID = getpid();
+ int pid = getpid();
// Make sure it's correct
- if (PID <= 0) {
+ if (pid <= 0) {
// Incorrect PID
return -1;
}
// Successful
- return PID;
+ return pid;
}
@catch (NSException *exception) {
// Error
@@ -35,248 +35,4 @@ + (int)processID {
}
}
-// Process Name
-+ (NSString *)processName {
- // Get the process name
- @try {
- // Set up the variables
- struct kinfo_proc info;
- size_t length = sizeof(struct kinfo_proc);
- int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, [self processID] };
-
- if (sysctl(mib, 4, &info, &length, NULL, 0) < 0)
- // Unknown value
- return nil;
-
- if (length == 0)
- // Unknown value
- return nil;
-
- // Make string for the PID Name
- NSString *processName = [[NSString alloc] initWithFormat:@"%s", info.kp_proc.p_comm];
-
- // Check to make sure it's valid
- if (processName == nil || processName.length <= 0) {
- // No PID Name found
- return nil;
- }
-
- // Successful
- return processName;
- }
- @catch (NSException *exception) {
- // Error
- return nil;
- }
-}
-
-// Process Status
-+ (int)processStatus {
- // Get the process status
- @try {
- // Set up the variables
- struct kinfo_proc info;
- size_t length = sizeof(struct kinfo_proc);
- int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, [self processID] };
-
- if (sysctl(mib, 4, &info, &length, NULL, 0) < 0)
- // Unknown value
- return -1;
-
- if (length == 0)
- // Unknown value
- return -1;
-
- // Make string for the process status
- int processStatus = info.kp_proc.p_stat;
-
- // Check to make sure it's valid
- if (processStatus <= 0) {
- // No PID Status found
- return -1;
- }
-
- // Successful
- return processStatus;
- }
- @catch (NSException *exception) {
- // Error
- return -1;
- }
-}
-
-// Parent Process ID
-+ (int)parentPID {
- // Get the parent process ID
- @try {
- // Get the Parent PID
- int ParentPID = [self parentPIDForProcess:[self processID]];
-
- // Check to make sure it's valid
- if (ParentPID <= 0) {
- // No PPID found
- return -1;
- }
-
- // Successful
- return ParentPID;
- }
- @catch (NSException *exception) {
- // Error
- return -1;
- }
-}
-
-// Parent ID for a certain PID
-+ (int)parentPIDForProcess:(int)pid {
- // Get the parent ID for a certain process
- @try {
- // Set up the variables
- struct kinfo_proc info;
- size_t length = sizeof(struct kinfo_proc);
- int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid };
-
- if (sysctl(mib, 4, &info, &length, NULL, 0) < 0)
- // Unknown value
- return -1;
-
- if (length == 0)
- // Unknown value
- return -1;
-
- // Make an int for the PPID
- int PPID = info.kp_eproc.e_ppid;
-
- // Check to make sure it's valid
- if (PPID <= 0) {
- // No PPID found
- return -1;
- }
-
- // Successful
- return PPID;
- }
- @catch (NSException *exception) {
- // Error
- return -1;
- }
-}
-
-// List of process information including PID's, Names, PPID's, and Status'
-+ (NSMutableArray *)processesInformation {
- // Get the list of processes and all information about them
- @try {
- // Make a new integer array holding all the kernel processes
- int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0};
-
- // Make a new size of 4
- size_t miblen = 4;
-
- size_t size = 0;
- int st = sysctl(mib, (int)miblen, NULL, &size, NULL, 0);
-
- // Set up the processes and new process struct
- struct kinfo_proc *process = NULL;
- struct kinfo_proc *newprocess = NULL;
-
- // do, while loop rnning through all the processes
- do {
- size += size / 10;
- newprocess = realloc(process, size);
-
- if (!newprocess) {
- if (process) free(process);
- // Error
- return nil;
- }
-
- process = newprocess;
- st = sysctl(mib, (int)miblen, process, &size, NULL, 0);
-
- } while (st == -1 && errno == ENOMEM);
-
- if (st == 0) {
- if (size % sizeof(struct kinfo_proc) == 0) {
- int nprocess = (int)(size / sizeof(struct kinfo_proc));
-
- if (nprocess) {
- NSMutableArray *array = [[NSMutableArray alloc] init];
-
- for (int i = nprocess - 1; i >= 0; i--) {
-
- NSString *processID = [[NSString alloc] initWithFormat:@"%d", process[i].kp_proc.p_pid];
- NSString *processName = [[NSString alloc] initWithFormat:@"%s", process[i].kp_proc.p_comm];
- NSString *processPriority = [[NSString alloc] initWithFormat:@"%d", process[i].kp_proc.p_priority];
- NSDate *processStartDate = [NSDate dateWithTimeIntervalSince1970:process[i].kp_proc.p_un.__p_starttime.tv_sec];
- NSString *processParentID = [[NSString alloc] initWithFormat:@"%d", [self parentPIDForProcess:(int)process[i].kp_proc.p_pid]];
- NSString *processStatus = [[NSString alloc] initWithFormat:@"%d", (int)process[i].kp_proc.p_stat];
- NSString *processFlags = [[NSString alloc] initWithFormat:@"%d", (int)process[i].kp_proc.p_flag];
-
- // Check to make sure all values are valid (if not, make them)
- if (processID == nil || processID.length <= 0) {
- // Invalid value
- processID = @"Unkown";
- }
- if (processName == nil || processName.length <= 0) {
- // Invalid value
- processName = @"Unkown";
- }
- if (processPriority == nil || processPriority.length <= 0) {
- // Invalid value
- processPriority = @"Unkown";
- }
- if (processStartDate == nil) {
- // Invalid value
- processStartDate = [NSDate date];
- }
- if (processParentID == nil || processParentID.length <= 0) {
- // Invalid value
- processParentID = @"Unkown";
- }
- if (processStatus == nil || processStatus.length <= 0) {
- // Invalid value
- processStatus = @"Unkown";
- }
- if (processFlags == nil || processFlags.length <= 0) {
- // Invalid value
- processFlags = @"Unkown";
- }
-
- // Create an array of the objects
- NSArray *ItemArray = [NSArray arrayWithObjects:processID, processName, processPriority, processStartDate, processParentID, processStatus, processFlags, nil];
-
- // Create an array of keys
- NSArray *KeyArray = [NSArray arrayWithObjects:@"PID", @"Name", @"Priority", @"StartDate", @"ParentID", @"Status", @"Flags", nil];
-
- // Create the dictionary
- NSDictionary *dict = [[NSDictionary alloc] initWithObjects:ItemArray forKeys:KeyArray];
-
- // Add the objects to the array
- [array addObject:dict];
- }
-
- // Make sure the array is usable
- if (array.count <= 0) {
- // Error, nothing in array
- return nil;
- }
-
- // Free the process
- free(process);
-
- // Successful
- return array;
- }
- }
- }
-
- // Something failed
- return nil;
- }
- @catch (NSException * ex) {
- // Error
- return nil;
- }
-}
-
@end
diff --git a/System Services/Utilities/SSProcessorInfo.h b/System Services/Utilities/SSProcessorInfo.h
index 78e5aa9..80ad9d4 100755
--- a/System Services/Utilities/SSProcessorInfo.h
+++ b/System Services/Utilities/SSProcessorInfo.h
@@ -8,7 +8,6 @@
#import
-NS_CLASS_DEPRECATED_IOS(2_0, 9_0, "SSProcessorInfo is deprecated. Process information is no longer allowed in iOS 9")
@interface SSProcessorInfo : NSObject
// Processor Information
@@ -19,10 +18,7 @@ NS_CLASS_DEPRECATED_IOS(2_0, 9_0, "SSProcessorInfo is deprecated. Process inform
// Number of Active Processors
+ (NSInteger)numberActiveProcessors;
-// Processor Speed in MHz
-+ (NSInteger)processorSpeed;
-
-// Processor Bus Speed in MHz
-+ (NSInteger)processorBusSpeed;
+// Get Processor Usage Information (i.e. ["0.2216801", "0.1009614"])
++ (NSArray *)processorsUsage;
@end
diff --git a/System Services/Utilities/SSProcessorInfo.m b/System Services/Utilities/SSProcessorInfo.m
index d4aaa6d..518c581 100755
--- a/System Services/Utilities/SSProcessorInfo.m
+++ b/System Services/Utilities/SSProcessorInfo.m
@@ -1,4 +1,4 @@
-//
+ //
// SSProcessorInfo.m
// SystemServicesDemo
//
@@ -11,6 +11,9 @@
// Sysctl
#import
+// Mach
+#include
+
@implementation SSProcessorInfo
// Processor Information
@@ -43,64 +46,67 @@ + (NSInteger)numberActiveProcessors {
}
}
-// Processor Speed in MHz
-+ (NSInteger)processorSpeed {
- // Try to get the processor speed
- @try {
- // Set the variables
- int hertz;
- size_t size = sizeof(int);
- int mib[2] = {CTL_HW, HW_CPU_FREQ};
-
- // Find the speed
- sysctl(mib, 2, &hertz, &size, NULL, 0);
+// Get Processor Usage Information (i.e. ["0.2216801", "0.1009614"])
++ (NSArray *)processorsUsage {
+
+ // Try to get Processor Usage Info
+ @try {
+ // Variables
+ processor_info_array_t _cpuInfo, _prevCPUInfo = nil;
+ mach_msg_type_number_t _numCPUInfo, _numPrevCPUInfo = 0;
+ unsigned _numCPUs;
+ NSLock *_cpuUsageLock;
- // Make sure it's not less than 0
- if (hertz < 1) {
- // Invalid value
- return -1;
- }
+ // Get the number of processors from sysctl
+ int _mib[2U] = { CTL_HW, HW_NCPU };
+ size_t _sizeOfNumCPUs = sizeof(_numCPUs);
+ int _status = sysctl(_mib, 2U, &_numCPUs, &_sizeOfNumCPUs, NULL, 0U);
+ if (_status)
+ _numCPUs = 1;
- // Divide the final speed by 1 million to get the speed in mhz
- hertz /= 1000000;
+ // Allocate the lock
+ _cpuUsageLock = [[NSLock alloc] init];
- // Return the result
- return hertz;
- }
- @catch (NSException * ex) {
- // Unable to get the speed (return -1)
- return -1;
- }
-}
-
-// Processor Bus Speed in MHz
-+ (NSInteger)processorBusSpeed {
- // Try to get the processor bus speed
- @try {
- // Set the variables
- size_t size;
- int speed[2];
- int final;
-
- // Find the speeds
- speed[0] = CTL_HW;
- speed[1] = HW_BUS_FREQ;
- size = sizeof(final);
-
- // Get the actual speed
- sysctl(speed, 2, &final, &size, NULL, 0);
- if (final > 0)
- final /= 1000000;
- else
- return -1;
-
- // Return the result
- return final;
- }
- @catch (NSException * ex) {
- // Unable to get the speed (return -1)
- return -1;
- }
+ // Get the processor info
+ natural_t _numCPUsU = 0U;
+ kern_return_t err = host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &_numCPUsU, &_cpuInfo, &_numCPUInfo);
+ if (err == KERN_SUCCESS) {
+ [_cpuUsageLock lock];
+
+ // Go through info for each processor
+ NSMutableArray *processorInfo = [NSMutableArray new];
+ for (unsigned i = 0U; i < _numCPUs; ++i) {
+ Float32 _inUse, _total;
+ if (_prevCPUInfo) {
+ _inUse = (
+ (_cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_USER] - _prevCPUInfo[(CPU_STATE_MAX * i) + CPU_STATE_USER])
+ + (_cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_SYSTEM] - _prevCPUInfo[(CPU_STATE_MAX * i) + CPU_STATE_SYSTEM])
+ + (_cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_NICE] - _prevCPUInfo[(CPU_STATE_MAX * i) + CPU_STATE_NICE])
+ );
+ _total = _inUse + (_cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_IDLE] - _prevCPUInfo[(CPU_STATE_MAX * i) + CPU_STATE_IDLE]);
+ } else {
+ _inUse = _cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_USER] + _cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_SYSTEM] + _cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_NICE];
+ _total = _inUse + _cpuInfo[(CPU_STATE_MAX * i) + CPU_STATE_IDLE];
+ }
+ // Add to the processor usage info
+ [processorInfo addObject:@(_inUse / _total)];
+ }
+
+ [_cpuUsageLock unlock];
+ if (_prevCPUInfo) {
+ size_t prevCpuInfoSize = sizeof(integer_t) * _numPrevCPUInfo;
+ vm_deallocate(mach_task_self(), (vm_address_t)_prevCPUInfo, prevCpuInfoSize);
+ }
+ // Retrieved processor information
+ return processorInfo;
+ } else {
+ // Unable to get processor information
+ return nil;
+ }
+ } @catch (NSException *exception) {
+ // Getting processor information failed
+ return nil;
+ }
}
@end
diff --git a/System Services/Utilities/SSUUID.h b/System Services/Utilities/SSUUID.h
index e2564c2..bd12216 100755
--- a/System Services/Utilities/SSUUID.h
+++ b/System Services/Utilities/SSUUID.h
@@ -10,14 +10,6 @@
@interface SSUUID : NSObject
-// Universal Unique Identifiers
-
-// Unique ID - Unique Identifier based on unchanging information about the device
-+ (nullable NSString *)uniqueID NS_DEPRECATED_IOS(2_0, 8_0);
-
-// Device Signature - Device Signature based on assorted information about the device including: SystemVersion, ScreenHeight, ScreenWidth, PluggedIn, Jailbroken, HeadphonesAttached, BatteryLevel, FullyCharged, ConnectedtoWiFi, DeviceOrientation, Country, TimeZone, NumberProcessors, ProcessorSpeed, TotalDiskSpace, TotalMemory, and a Salt
-+ (nullable NSString *)deviceSignature NS_DEPRECATED_IOS(2_0, 8_0);
-
// CFUUID - Random Unique Identifier that changes every time
+ (nullable NSString *)cfuuid;
diff --git a/System Services/Utilities/SSUUID.m b/System Services/Utilities/SSUUID.m
index 2483ce5..4d6e1f4 100755
--- a/System Services/Utilities/SSUUID.m
+++ b/System Services/Utilities/SSUUID.m
@@ -20,273 +20,6 @@
@implementation SSUUID
-// UDID Replacement Based on SystemServices Device Signature
-
-// Unique ID
-+ (NSString *)uniqueID {
- // Get a Unique ID from the Device
-
- // Create a string
- NSString *UniqueIdentifier;
-
- // Get the Device Model
- NSString *DeviceModel = [[SSHardwareInfo deviceModel] capitalizedString];
- DeviceModel = [[DeviceModel substringWithRange:NSMakeRange([DeviceModel length] - 1, 1)] capitalizedString];
-
- // Get the System Name
- NSString *SystemName = [[[SSHardwareInfo systemName] substringWithRange:NSMakeRange(2, 1)] capitalizedString];
-
- // Get the Device Type
- NSString *DeviceType = [[SSHardwareInfo systemDeviceTypeFormatted:NO] capitalizedString];
- DeviceType = [DeviceType substringWithRange:NSMakeRange([DeviceType length] - 1, 1)];
-
- // Get the Screen Width
- NSString *ScreenWidth = [[[NSString stringWithFormat:@"%ld", (long)[SSHardwareInfo screenWidth]] substringToIndex:1] capitalizedString];
-
- // Get the Screen Height
- NSString *ScreenHeight = [[[NSString stringWithFormat:@"%ld", (long)[SSHardwareInfo screenHeight]] substringToIndex:1] capitalizedString];
-
- // Check if Multitasking is Enabled
- NSString *MultitaskingEnabled = [[[NSString stringWithFormat:@"%d", [SSHardwareInfo multitaskingEnabled]] substringToIndex:1] capitalizedString];
-
- // Check if the proximity sensor exists
- NSString *ProximitySensorEnabled = [[[NSString stringWithFormat:@"%d", [SSHardwareInfo proximitySensorEnabled]] substringToIndex:1] capitalizedString];
-
- // Get the number of processors
- NSString *NumberProcessors = [[[NSString stringWithFormat:@"%ld", (long)[SSProcessorInfo numberProcessors]] substringToIndex:1] capitalizedString];
-
- // Get the processor Speed
- NSString *ProcessorSpeed = [[[NSString stringWithFormat:@"%ld", (long)[SSProcessorInfo processorSpeed]] substringToIndex:1] capitalizedString];
-
- // Get the Cell MAC Address
- NSString *CellMACAddress = [[[SSNetworkInfo cellMACAddress] substringToIndex:1] capitalizedString];
-
- // Get the WiFi MAC Address
- NSString *WiFiMACAddress = [[[SSNetworkInfo wiFiMACAddress] substringToIndex:1] capitalizedString];
-
- // Get the WiFi MAC Address different sector (5)
- NSString *WiFiMACAddress2 = [[[SSNetworkInfo wiFiMACAddress] substringWithRange:NSMakeRange(4, 1)] capitalizedString];
-
- // Get the WiFi MAC Address different sector (10)
- NSString *WiFiMACAddress3 = [[[SSNetworkInfo wiFiMACAddress] substringWithRange:NSMakeRange(9, 1)] capitalizedString];
-
- // Get the total disk space
- NSString *TotalDiskSpace = [[[SSDiskInfo diskSpace] substringToIndex:1] capitalizedString];
-
- // Create a salt
- NSString *Salt = @"6";
-
- // Create an additional salt
- NSString *Salty = @"S";
-
- // Error check
- if (DeviceModel == nil || DeviceModel.length <= 0 || DeviceModel.length > 1 || [DeviceModel isEqualToString:@"-"]) {
- // Invalid String
- DeviceModel = @"1";
- }
- if (SystemName == nil || SystemName.length <= 0 || SystemName.length > 1 || [SystemName isEqualToString:@"-"]) {
- // Invalid String
- SystemName = @"1";
- }
- if (DeviceType == nil || DeviceType.length <= 0 || DeviceType.length > 1 || [DeviceType isEqualToString:@"-"]) {
- // Invalid String
- DeviceType = @"1";
- }
- if (ScreenWidth == nil || ScreenWidth.length <= 0 || ScreenWidth.length > 1 || [ScreenWidth isEqualToString:@"-"]) {
- // Invalid String
- ScreenWidth = @"1";
- }
- if (ScreenHeight == nil || ScreenHeight.length <= 0 || ScreenHeight.length > 1 || [ScreenHeight isEqualToString:@"-"]) {
- // Invalid String
- ScreenHeight = @"1";
- }
- if (MultitaskingEnabled == nil || MultitaskingEnabled.length <= 0 || MultitaskingEnabled.length > 1 || [MultitaskingEnabled isEqualToString:@"-"]) {
- // Invalid String
- MultitaskingEnabled = @"1";
- }
- if (ProximitySensorEnabled == nil || ProximitySensorEnabled.length <= 0 || ProximitySensorEnabled.length > 1 || [ProximitySensorEnabled isEqualToString:@"-"]) {
- // Invalid String
- ProximitySensorEnabled = @"1";
- }
- if (NumberProcessors == nil || NumberProcessors.length <= 0 || NumberProcessors.length > 1 || [NumberProcessors isEqualToString:@"-"]) {
- // Invalid String
- NumberProcessors = @"1";
- }
- if (ProcessorSpeed == nil || ProcessorSpeed.length <= 0 || ProcessorSpeed.length > 1 || [ProcessorSpeed isEqualToString:@"-"]) {
- // Invalid String
- ProcessorSpeed = @"1";
- }
- if (CellMACAddress == nil || CellMACAddress.length <= 0 || CellMACAddress.length > 1 || [CellMACAddress isEqualToString:@"-"]) {
- // Invalid String
- CellMACAddress = @"1";
- }
- if (WiFiMACAddress == nil || WiFiMACAddress.length <= 0 || WiFiMACAddress.length > 1 || [WiFiMACAddress isEqualToString:@"-"]) {
- // Invalid String
- WiFiMACAddress = @"1";
- }
- if (WiFiMACAddress2 == nil || WiFiMACAddress2.length <= 0 || WiFiMACAddress2.length > 1 || [WiFiMACAddress2 isEqualToString:@"-"]) {
- // Invalid String
- WiFiMACAddress2 = @"1";
- }
- if (WiFiMACAddress3 == nil || WiFiMACAddress3.length <= 0 || WiFiMACAddress3.length > 1 || [WiFiMACAddress3 isEqualToString:@"-"]) {
- // Invalid String
- WiFiMACAddress3 = @"1";
- }
- if (TotalDiskSpace == nil || TotalDiskSpace.length <= 0 || TotalDiskSpace.length > 1 || [TotalDiskSpace isEqualToString:@"-"]) {
- // Invalid String
- TotalDiskSpace = @"1";
- }
-
- // Create the Unique ID Based on these Unchanging System Variables
- UniqueIdentifier = [NSString stringWithFormat:@"%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@", Salt, DeviceModel, SystemName, DeviceType, ScreenWidth, ScreenHeight, MultitaskingEnabled, ProximitySensorEnabled, NumberProcessors, ProcessorSpeed, CellMACAddress, WiFiMACAddress, WiFiMACAddress2, WiFiMACAddress3, TotalDiskSpace, Salty];
-
- // Check for errors
- if (UniqueIdentifier == nil || UniqueIdentifier.length <= 0 || UniqueIdentifier.length > 16) {
- // Error, invalid UUID
- return nil;
- }
-
- // Completed Successfully
- return UniqueIdentifier;
-}
-
-// Device Signature
-+ (NSString *)deviceSignature {
- // Get a comprehensive device signature
-
- // Create a string
- NSString *DeviceSignature;
-
- // Get the System Version
- NSString *SystemVersion = [NSString stringWithFormat:@"%d", [[SSHardwareInfo systemVersion] intValue]];
-
- // Get the Screen Height
- NSString *ScreenHeight = [NSString stringWithFormat:@"%ld", (long)[SSHardwareInfo screenHeight]];
-
- // Get the Screen Width
- NSString *ScreenWidth = [NSString stringWithFormat:@"%ld", (long)[SSHardwareInfo screenWidth]];
-
- // Plugged In
- NSString *PluggedIn = [NSString stringWithFormat:@"%d", [SSHardwareInfo pluggedIn]];
-
- // Jailbroken
- NSString *Jailbroken = [NSString stringWithFormat:@"%d", [SSJailbreakCheck jailbroken]];
-
- // Headphones Attached
- NSString *HeadphonesAttached = [NSString stringWithFormat:@"%d", [SSAccessoryInfo headphonesAttached]];
-
- // Battery Level
- NSString *BatteryLevel = [NSString stringWithFormat:@"%d", (int)[SSBatteryInfo batteryLevel]];
-
- // Fully Charged
- NSString *FullyCharged = [NSString stringWithFormat:@"%d", [SSBatteryInfo fullyCharged]];
-
- // Connected to WiFi
- NSString *ConnectedtoWiFi = [NSString stringWithFormat:@"%d", [SSNetworkInfo connectedToWiFi]];
-
- // Device Orientation
- NSString *DeviceOrientation = [NSString stringWithFormat:@"%ld", [SSAccelerometerInfo deviceOrientation]];
-
- // Country
- NSString *Country = [[[SSLocalizationInfo country] substringToIndex:2] uppercaseString];
-
- // TimeZone
- NSString *TimeZone = [[[SSLocalizationInfo timeZone] substringToIndex:2] uppercaseString];
-
- // Number Processors
- NSString *NumberProcessors = [NSString stringWithFormat:@"%ld", (long)[SSProcessorInfo numberProcessors]];
-
- // Processor Speed
- NSString *ProcessorSpeed = [NSString stringWithFormat:@"%ld", (long)[SSProcessorInfo processorSpeed]];
-
- // Total Disk Space
- NSString *TotalDiskSpace = [NSString stringWithFormat:@"%d", [[SSDiskInfo diskSpace] intValue] ];
-
- // Total Memory
- NSString *TotalMemory = [NSString stringWithFormat:@"%d", (int)[SSMemoryInfo totalMemory]];
-
- // Salt
- NSString *Salt = @"SS";
-
- // Check for errors
- if (SystemVersion == nil || SystemVersion.length <= 0 || SystemVersion.length > 3) {
- // Invalid String
- SystemVersion = @"00";
- }
- if (ScreenHeight == nil || ScreenHeight.length <= 0 || ScreenHeight.length > 4) {
- // Invalid String
- ScreenHeight = @"0000";
- }
- if (ScreenWidth == nil || ScreenWidth.length <= 0 || ScreenWidth.length > 4) {
- // Invalid String
- ScreenWidth = @"0000";
- }
- if (PluggedIn == nil || PluggedIn.length <= 0 || PluggedIn.length > 1) {
- // Invalid String
- PluggedIn = @"0";
- }
- if (Jailbroken == nil || Jailbroken.length <= 0 || Jailbroken.length > 1) {
- // Invalid String
- Jailbroken = @"0";
- }
- if (HeadphonesAttached == nil || HeadphonesAttached.length <= 0 || HeadphonesAttached.length > 1) {
- // Invalid String
- HeadphonesAttached = @"0";
- }
- if (BatteryLevel == nil || BatteryLevel.length <= 0 || [BatteryLevel rangeOfString:@"-"].location != NSNotFound) {
- // Invalid String
- BatteryLevel = @"00";
- }
- if (FullyCharged == nil || FullyCharged.length <= 0 || FullyCharged.length > 1) {
- // Invalid String
- FullyCharged = @"0";
- }
- if (ConnectedtoWiFi == nil || ConnectedtoWiFi.length <= 0 || ConnectedtoWiFi.length > 1) {
- // Invalid String
- ConnectedtoWiFi = @"0";
- }
- if (DeviceOrientation == nil || DeviceOrientation.length <= 0 || DeviceOrientation.length > 1) {
- // Invalid String
- DeviceOrientation = @"0";
- }
- if (Country == nil || Country.length <= 0 || Country.length > 2) {
- // Invalid String
- Country = @"00";
- }
- if (TimeZone == nil || TimeZone.length <= 0 || TimeZone.length > 2) {
- // Invalid String
- TimeZone = @"00";
- }
- if (NumberProcessors == nil || NumberProcessors.length <= 0 || NumberProcessors.length > 2 || [NumberProcessors rangeOfString:@"-"].location != NSNotFound) {
- // Invalid String
- NumberProcessors = @"0";
- }
- if (ProcessorSpeed == nil || ProcessorSpeed.length <= 0 || ProcessorSpeed.length > 3 || [ProcessorSpeed rangeOfString:@"-"].location != NSNotFound) {
- // Invalid String
- ProcessorSpeed = @"000";
- }
- if (TotalDiskSpace == nil || TotalDiskSpace.length <= 0 || TotalDiskSpace.length > 3 || [TotalDiskSpace rangeOfString:@"-"].location != NSNotFound) {
- // Invalid String
- TotalDiskSpace = @"000";
- }
- if (TotalMemory == nil || TotalMemory.length <= 0 || TotalMemory.length > 3 || [TotalMemory rangeOfString:@"-"].location != NSNotFound) {
- // Invalid String
- TotalMemory = @"000";
- }
-
- // Create the Device Signature based on the values
- DeviceSignature = [NSString stringWithFormat:@"%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@%@", SystemVersion, ScreenHeight, ScreenWidth, PluggedIn, Jailbroken, HeadphonesAttached, BatteryLevel, FullyCharged, ConnectedtoWiFi, DeviceOrientation, Country, TimeZone, NumberProcessors, ProcessorSpeed, TotalDiskSpace, TotalMemory, Salt];
-
- // Check for errors
- if (DeviceSignature == nil || DeviceSignature.length <= 0) {
- // Error, invalid Device Signature
- return nil;
- }
-
- // Completed Successfully
- return DeviceSignature;
-}
-
// CFUUID
+ (NSString *)cfuuid {
// Create a new CFUUID (Unique, random ID number) (Always different)
@@ -298,10 +31,10 @@ + (NSString *)cfuuid {
if (theUUID)
{
// Make the new UUID String
- NSString *TempUniqueID = (__bridge NSString *)CFUUIDCreateString(kCFAllocatorDefault, theUUID);
+ NSString *tempUniqueID = (__bridge NSString *)CFUUIDCreateString(kCFAllocatorDefault, theUUID);
// Check to make sure it created it
- if (TempUniqueID == nil || TempUniqueID.length <= 0) {
+ if (tempUniqueID == nil || tempUniqueID.length <= 0) {
// Error, Unable to create
// Release the UUID Reference
CFRelease(theUUID);
@@ -313,7 +46,7 @@ + (NSString *)cfuuid {
CFRelease(theUUID);
// Successful
- return TempUniqueID;
+ return tempUniqueID;
} else {
// Error
// Release the UUID Reference
diff --git a/System Services/Utilities/route.h b/System Services/Utilities/route.h
index 8dfa582..eff8b1d 100644
--- a/System Services/Utilities/route.h
+++ b/System Services/Utilities/route.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000-2015 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
@@ -61,7 +61,6 @@
* $FreeBSD: src/sys/net/route.h,v 1.36.2.1 2000/08/16 06:14:23 jayanth Exp $
*/
-#if !(TARGET_IPHONE_SIMULATOR)
#ifndef _NET_ROUTE_H_
#define _NET_ROUTE_H_
#include
@@ -74,17 +73,17 @@
* retransmission behavior and are included in the routing structure.
*/
struct rt_metrics {
- u_int32_t rmx_locks; /* Kernel leaves these values alone */
- u_int32_t rmx_mtu; /* MTU for this path */
- u_int32_t rmx_hopcount; /* max hops expected */
- int32_t rmx_expire; /* lifetime for route, e.g. redirect */
- u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */
- u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */
- u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */
- u_int32_t rmx_rtt; /* estimated round trip time */
- u_int32_t rmx_rttvar; /* estimated rtt variance */
- u_int32_t rmx_pksent; /* packets sent using this route */
- u_int32_t rmx_filler[4]; /* will be used for T/TCP later */
+ u_int32_t rmx_locks; /* Kernel leaves these values alone */
+ u_int32_t rmx_mtu; /* MTU for this path */
+ u_int32_t rmx_hopcount; /* max hops expected */
+ int32_t rmx_expire; /* lifetime for route, e.g. redirect */
+ u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */
+ u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */
+ u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */
+ u_int32_t rmx_rtt; /* estimated round trip time */
+ u_int32_t rmx_rttvar; /* estimated rtt variance */
+ u_int32_t rmx_pksent; /* packets sent using this route */
+ u_int32_t rmx_filler[4]; /* will be used for T/TCP later */
};
/*
@@ -114,7 +113,7 @@ struct rt_metrics {
#define RTF_PRCLONING 0x10000 /* protocol requires cloning */
#define RTF_WASCLONED 0x20000 /* route generated through cloning */
#define RTF_PROTO3 0x40000 /* protocol specific routing flag */
-/* 0x80000 unused */
+ /* 0x80000 unused */
#define RTF_PINNED 0x100000 /* future use */
#define RTF_LOCAL 0x200000 /* route represents a local address */
#define RTF_BROADCAST 0x400000 /* route represents a bcast address */
@@ -124,57 +123,57 @@ struct rt_metrics {
#define RTF_IFREF 0x4000000 /* route holds a ref to interface */
#define RTF_PROXY 0x8000000 /* proxying, no interface scope */
#define RTF_ROUTER 0x10000000 /* host is a router */
-/* 0x20000000 and up unassigned */
+ /* 0x20000000 and up unassigned */
#define RTF_BITS \
-"\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \
-"\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \
-"\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \
-"\25PINNED\26LOCAL\27BROADCAST\30MULTICAST\31IFSCOPE\32CONDEMNED" \
-"\33IFREF\34PROXY\35ROUTER"
+ "\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \
+ "\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \
+ "\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \
+ "\25PINNED\26LOCAL\27BROADCAST\30MULTICAST\31IFSCOPE\32CONDEMNED" \
+ "\33IFREF\34PROXY\35ROUTER"
/*
* Routing statistics.
*/
struct rtstat {
- short rts_badredirect; /* bogus redirect calls */
- short rts_dynamic; /* routes created by redirects */
- short rts_newgateway; /* routes modified by redirects */
- short rts_unreach; /* lookups which failed */
- short rts_wildcard; /* lookups satisfied by a wildcard */
+ short rts_badredirect; /* bogus redirect calls */
+ short rts_dynamic; /* routes created by redirects */
+ short rts_newgateway; /* routes modified by redirects */
+ short rts_unreach; /* lookups which failed */
+ short rts_wildcard; /* lookups satisfied by a wildcard */
};
/*
* Structures for routing messages.
*/
struct rt_msghdr {
- u_short rtm_msglen; /* to skip over non-understood messages */
- u_char rtm_version; /* future binary compatibility */
- u_char rtm_type; /* message type */
- u_short rtm_index; /* index for associated ifp */
- int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
- int rtm_addrs; /* bitmask identifying sockaddrs in msg */
- pid_t rtm_pid; /* identify sender */
- int rtm_seq; /* for sender to identify action */
- int rtm_errno; /* why failed */
- int rtm_use; /* from rtentry */
- u_int32_t rtm_inits; /* which metrics we are initializing */
- struct rt_metrics rtm_rmx; /* metrics themselves */
+ u_short rtm_msglen; /* to skip over non-understood messages */
+ u_char rtm_version; /* future binary compatibility */
+ u_char rtm_type; /* message type */
+ u_short rtm_index; /* index for associated ifp */
+ int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
+ int rtm_addrs; /* bitmask identifying sockaddrs in msg */
+ pid_t rtm_pid; /* identify sender */
+ int rtm_seq; /* for sender to identify action */
+ int rtm_errno; /* why failed */
+ int rtm_use; /* from rtentry */
+ u_int32_t rtm_inits; /* which metrics we are initializing */
+ struct rt_metrics rtm_rmx; /* metrics themselves */
};
struct rt_msghdr2 {
- u_short rtm_msglen; /* to skip over non-understood messages */
- u_char rtm_version; /* future binary compatibility */
- u_char rtm_type; /* message type */
- u_short rtm_index; /* index for associated ifp */
- int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
- int rtm_addrs; /* bitmask identifying sockaddrs in msg */
- int32_t rtm_refcnt; /* reference count */
- int rtm_parentflags; /* flags of the parent route */
- int rtm_reserved; /* reserved field set to 0 */
- int rtm_use; /* from rtentry */
- u_int32_t rtm_inits; /* which metrics we are initializing */
- struct rt_metrics rtm_rmx; /* metrics themselves */
+ u_short rtm_msglen; /* to skip over non-understood messages */
+ u_char rtm_version; /* future binary compatibility */
+ u_char rtm_type; /* message type */
+ u_short rtm_index; /* index for associated ifp */
+ int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
+ int rtm_addrs; /* bitmask identifying sockaddrs in msg */
+ int32_t rtm_refcnt; /* reference count */
+ int rtm_parentflags; /* flags of the parent route */
+ int rtm_reserved; /* reserved field set to 0 */
+ int rtm_use; /* from rtentry */
+ u_int32_t rtm_inits; /* which metrics we are initializing */
+ struct rt_metrics rtm_rmx; /* metrics themselves */
};
@@ -188,7 +187,7 @@ struct rt_msghdr2 {
#define RTM_CHANGE 0x3 /* Change Metrics or flags */
#define RTM_GET 0x4 /* Report Metrics */
#define RTM_LOSING 0x5 /* RTM_LOSING is no longer generated by xnu
-and is deprecated */
+ and is deprecated */
#define RTM_REDIRECT 0x6 /* Told to use different route */
#define RTM_MISS 0x7 /* Lookup failed on this address */
#define RTM_LOCK 0x8 /* fix specified metrics */
@@ -242,10 +241,9 @@ and is deprecated */
#define RTAX_MAX 8 /* size of array to allocate */
struct rt_addrinfo {
- int rti_addrs;
- struct sockaddr *rti_info[RTAX_MAX];
+ int rti_addrs;
+ struct sockaddr *rti_info[RTAX_MAX];
};
#endif /* _NET_ROUTE_H_ */
-#endif /* TARGET_IPHONE_SIMULATOR */
diff --git a/SystemServices.podspec b/SystemServices.podspec
index 2e1640f..71362d3 100644
--- a/SystemServices.podspec
+++ b/SystemServices.podspec
@@ -9,31 +9,30 @@
Pod::Spec.new do |s|
s.name = "SystemServices"
- s.version = "1.1.1"
+ s.version = "2.0.1"
s.summary = "iOS System Services is a class to gather all available information about a device."
s.description = <<-DESC
- This is a singleton class to gather all available information about a device. It gives you over 75 methods to determine everything about a device, including:
+ This is a singleton class to gather all available information about a device. It gives you over 60 methods to determine everything about a device, including:
- Hardware & Network Information
+ Hardware Information
+ Network Information
Battery Usage
Accelerometer Data
Disk Usage
- Running Processes
Memory Usage
- And a complete UDID replacement based on unchanging device information.
DESC
s.homepage = "https://github.com/Shmoopi/iOS-System-Services"
s.screenshots = [ "https://raw.githubusercontent.com/Shmoopi/iOS-System-Services/master/Sample%20Images/Screenshot1.png",
"https://raw.githubusercontent.com/Shmoopi/iOS-System-Services/master/Sample%20Images/Screenshot2.png" ]
- s.license = "MIT"
+ s.license = { :type => 'MIT' }
s.author = { "Shmoopi" => "shmoopillc@gmail.com" }
s.social_media_url = "http://twitter.com/shmoopillc"
s.platform = :ios
- s.platform = :ios, "6.0"
- s.source = { :git => "https://github.com/Shmoopi/iOS-System-Services.git", :tag => "1.1.1" }
+ s.platform = :ios, "8.0"
+ s.source = { :git => "https://github.com/Shmoopi/iOS-System-Services.git", :tag => "2.0.1" }
s.source_files = "SystemServices", "System Services/**/*.{h,m}"
s.frameworks = "AVFoundation", "CoreTelephony", "Security", "CoreMotion", "ExternalAccessory"
s.requires_arc = true
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.pbxproj b/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.pbxproj
index eb2703c..552ae24 100755
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.pbxproj
+++ b/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.pbxproj
@@ -40,7 +40,6 @@
4C44C5D517FC5491001E84DF /* SSProcessorInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C44C5C317FC5491001E84DF /* SSProcessorInfo.m */; };
4C44C5D617FC5491001E84DF /* SSUUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C44C5C517FC5491001E84DF /* SSUUID.m */; };
4C640E0A1607BF9D00955DE4 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C640E091607BF9D00955DE4 /* CoreTelephony.framework */; };
- 4C67F74817FB0BD300089C23 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C67F74717FB0BD300089C23 /* DetailViewController.m */; };
4C7D7D0F1C2B3CE200388E49 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C3C92571729B83200D88C01 /* QuartzCore.framework */; };
4C9C34FF17FA04D7004113FC /* Disk.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C9C34F517FA04D7004113FC /* Disk.png */; };
4C9C350017FA04D7004113FC /* Disk@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C9C34F617FA04D7004113FC /* Disk@2x.png */; };
@@ -50,8 +49,6 @@
4C9C350417FA04D7004113FC /* Memory@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C9C34FA17FA04D7004113FC /* Memory@2x.png */; };
4C9C350517FA04D7004113FC /* Network.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C9C34FB17FA04D7004113FC /* Network.png */; };
4C9C350617FA04D7004113FC /* Network@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C9C34FC17FA04D7004113FC /* Network@2x.png */; };
- 4C9C350717FA04D7004113FC /* Processes.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C9C34FD17FA04D7004113FC /* Processes.png */; };
- 4C9C350817FA04D7004113FC /* Processes@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C9C34FE17FA04D7004113FC /* Processes@2x.png */; };
4CB898F3178B1003005FE9CF /* MSAnnotatedGauge.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB898E6178B1003005FE9CF /* MSAnnotatedGauge.m */; };
4CB898F4178B1003005FE9CF /* MSArcLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB898E8178B1003005FE9CF /* MSArcLayer.m */; };
4CB898F5178B1003005FE9CF /* MSGradientArcLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB898EB178B1003005FE9CF /* MSGradientArcLayer.m */; };
@@ -61,7 +58,6 @@
4CCC7651170E09A40057A8A3 /* SystemServicesDemoNetworkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCC7650170E09A40057A8A3 /* SystemServicesDemoNetworkViewController.m */; };
4CCC7654170E09C20057A8A3 /* SystemServicesDemoMemoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCC7653170E09C20057A8A3 /* SystemServicesDemoMemoryViewController.m */; };
4CCC7657170E09CB0057A8A3 /* SystemServicesDemoDiskViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCC7656170E09CB0057A8A3 /* SystemServicesDemoDiskViewController.m */; };
- 4CCC765A170E09E10057A8A3 /* SystemServicesDemoProcessesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCC7659170E09E10057A8A3 /* SystemServicesDemoProcessesViewController.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -121,8 +117,7 @@
4C640E021607AAFA00955DE4 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
4C640E041607BB4C00955DE4 /* ExternalAccessory.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExternalAccessory.framework; path = System/Library/Frameworks/ExternalAccessory.framework; sourceTree = SDKROOT; };
4C640E091607BF9D00955DE4 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
- 4C67F74617FB0BD300089C23 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; };
- 4C67F74717FB0BD300089C23 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; };
+ 4C8ABAD91F6387A7009EBFCD /* route.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = route.h; sourceTree = ""; };
4C9C34F517FA04D7004113FC /* Disk.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Disk.png; sourceTree = ""; };
4C9C34F617FA04D7004113FC /* Disk@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Disk@2x.png"; sourceTree = ""; };
4C9C34F717FA04D7004113FC /* Hardware.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Hardware.png; sourceTree = ""; };
@@ -131,8 +126,6 @@
4C9C34FA17FA04D7004113FC /* Memory@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Memory@2x.png"; sourceTree = ""; };
4C9C34FB17FA04D7004113FC /* Network.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Network.png; sourceTree = ""; };
4C9C34FC17FA04D7004113FC /* Network@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Network@2x.png"; sourceTree = ""; };
- 4C9C34FD17FA04D7004113FC /* Processes.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Processes.png; sourceTree = ""; };
- 4C9C34FE17FA04D7004113FC /* Processes@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Processes@2x.png"; sourceTree = ""; };
4CB898E5178B1003005FE9CF /* MSAnnotatedGauge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSAnnotatedGauge.h; sourceTree = ""; };
4CB898E6178B1003005FE9CF /* MSAnnotatedGauge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSAnnotatedGauge.m; sourceTree = ""; };
4CB898E7178B1003005FE9CF /* MSArcLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSArcLayer.h; sourceTree = ""; };
@@ -153,9 +146,6 @@
4CCC7653170E09C20057A8A3 /* SystemServicesDemoMemoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SystemServicesDemoMemoryViewController.m; sourceTree = ""; };
4CCC7655170E09CB0057A8A3 /* SystemServicesDemoDiskViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemServicesDemoDiskViewController.h; sourceTree = ""; };
4CCC7656170E09CB0057A8A3 /* SystemServicesDemoDiskViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SystemServicesDemoDiskViewController.m; sourceTree = ""; };
- 4CCC7658170E09E10057A8A3 /* SystemServicesDemoProcessesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemServicesDemoProcessesViewController.h; sourceTree = ""; };
- 4CCC7659170E09E10057A8A3 /* SystemServicesDemoProcessesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SystemServicesDemoProcessesViewController.m; sourceTree = ""; };
- 4CE795B71CAB41710032FBD9 /* route.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = route.h; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -229,10 +219,6 @@
4CCC7653170E09C20057A8A3 /* SystemServicesDemoMemoryViewController.m */,
4CCC7655170E09CB0057A8A3 /* SystemServicesDemoDiskViewController.h */,
4CCC7656170E09CB0057A8A3 /* SystemServicesDemoDiskViewController.m */,
- 4CCC7658170E09E10057A8A3 /* SystemServicesDemoProcessesViewController.h */,
- 4CCC7659170E09E10057A8A3 /* SystemServicesDemoProcessesViewController.m */,
- 4C67F74617FB0BD300089C23 /* DetailViewController.h */,
- 4C67F74717FB0BD300089C23 /* DetailViewController.m */,
01ADF9FE16051BFE008B0A6B /* Supporting Files */,
);
path = SystemServicesDemo;
@@ -278,6 +264,7 @@
4C44C5A717FC5491001E84DF /* Utilities */ = {
isa = PBXGroup;
children = (
+ 4C8ABAD91F6387A7009EBFCD /* route.h */,
4C44C5AA17FC5491001E84DF /* SSAccelerometerInfo.h */,
4C44C5AB17FC5491001E84DF /* SSAccelerometerInfo.m */,
4C44C5AC17FC5491001E84DF /* SSAccessoryInfo.h */,
@@ -306,7 +293,6 @@
4C44C5C317FC5491001E84DF /* SSProcessorInfo.m */,
4C44C5C417FC5491001E84DF /* SSUUID.h */,
4C44C5C517FC5491001E84DF /* SSUUID.m */,
- 4CE795B71CAB41710032FBD9 /* route.h */,
);
path = Utilities;
sourceTree = "";
@@ -322,8 +308,6 @@
4C9C34FA17FA04D7004113FC /* Memory@2x.png */,
4C9C34FB17FA04D7004113FC /* Network.png */,
4C9C34FC17FA04D7004113FC /* Network@2x.png */,
- 4C9C34FD17FA04D7004113FC /* Processes.png */,
- 4C9C34FE17FA04D7004113FC /* Processes@2x.png */,
);
path = Images;
sourceTree = "";
@@ -376,14 +360,20 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = SystemServicesDemo;
- LastUpgradeCheck = 0710;
+ LastUpgradeCheck = 0900;
ORGANIZATIONNAME = "Shmoopi LLC";
+ TargetAttributes = {
+ 01ADF9F216051BFE008B0A6B = {
+ DevelopmentTeam = 46H57CBD4Q;
+ };
+ };
};
buildConfigurationList = 01ADF9ED16051BFE008B0A6B /* Build configuration list for PBXProject "SystemServicesDemo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
+ English,
en,
);
mainGroup = 01ADF9E816051BFE008B0A6B;
@@ -408,8 +398,6 @@
01ADFA0B16051BFE008B0A6B /* MainStoryboard.storyboard in Resources */,
4C9C350517FA04D7004113FC /* Network.png in Resources */,
013A5141160F4E3C00FC11BE /* Default-568h@2x.png in Resources */,
- 4C9C350717FA04D7004113FC /* Processes.png in Resources */,
- 4C9C350817FA04D7004113FC /* Processes@2x.png in Resources */,
4C9C350317FA04D7004113FC /* Memory.png in Resources */,
4C9C350017FA04D7004113FC /* Disk@2x.png in Resources */,
4C9C350117FA04D7004113FC /* Hardware.png in Resources */,
@@ -434,12 +422,10 @@
4C44C5C717FC5491001E84DF /* SystemServices.m in Sources */,
4C44C5CE17FC5491001E84DF /* SSDiskInfo.m in Sources */,
4C44C5CF17FC5491001E84DF /* SSHardwareInfo.m in Sources */,
- 4C67F74817FB0BD300089C23 /* DetailViewController.m in Sources */,
4CCC7651170E09A40057A8A3 /* SystemServicesDemoNetworkViewController.m in Sources */,
4C44C5CA17FC5491001E84DF /* SSAccessoryInfo.m in Sources */,
4CCC7654170E09C20057A8A3 /* SystemServicesDemoMemoryViewController.m in Sources */,
4CCC7657170E09CB0057A8A3 /* SystemServicesDemoDiskViewController.m in Sources */,
- 4CCC765A170E09E10057A8A3 /* SystemServicesDemoProcessesViewController.m in Sources */,
4C44C5D217FC5491001E84DF /* SSMemoryInfo.m in Sources */,
4C3C924D1729AF0A00D88C01 /* PCPieChart.m in Sources */,
4C44C5D117FC5491001E84DF /* SSLocalizationInfo.m in Sources */,
@@ -487,11 +473,19 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -514,7 +508,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
@@ -526,11 +520,19 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -545,7 +547,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 5.1;
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
@@ -555,6 +557,7 @@
01ADFA1216051BFE008B0A6B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ DEVELOPMENT_TEAM = 46H57CBD4Q;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SystemServicesDemo/SystemServicesDemo-Prefix.pch";
INFOPLIST_FILE = "SystemServicesDemo/SystemServicesDemo-Info.plist";
@@ -572,6 +575,7 @@
01ADFA1316051BFE008B0A6B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ DEVELOPMENT_TEAM = 46H57CBD4Q;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SystemServicesDemo/SystemServicesDemo-Prefix.pch";
INFOPLIST_FILE = "SystemServicesDemo/SystemServicesDemo-Info.plist";
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcshareddata/SystemServicesDemo.xccheckout b/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcshareddata/SystemServicesDemo.xccheckout
deleted file mode 100644
index 27f6e7d..0000000
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcshareddata/SystemServicesDemo.xccheckout
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
- IDESourceControlProjectFavoriteDictionaryKey
-
- IDESourceControlProjectIdentifier
- FC63221A-3753-4EDF-B683-5CE4C81A36F9
- IDESourceControlProjectName
- SystemServicesDemo
- IDESourceControlProjectOriginsDictionary
-
- 61970E288A198DF838C0CF33FD39CD74C0B09B92
- https://github.com/dimohamdy/iOS-System-Services.git
-
- IDESourceControlProjectPath
- SystemServicesDemo/SystemServicesDemo.xcodeproj
- IDESourceControlProjectRelativeInstallPathDictionary
-
- 61970E288A198DF838C0CF33FD39CD74C0B09B92
- ../../..
-
- IDESourceControlProjectURL
- https://github.com/dimohamdy/iOS-System-Services.git
- IDESourceControlProjectVersion
- 111
- IDESourceControlProjectWCCIdentifier
- 61970E288A198DF838C0CF33FD39CD74C0B09B92
- IDESourceControlProjectWCConfigurations
-
-
- IDESourceControlRepositoryExtensionIdentifierKey
- public.vcs.git
- IDESourceControlWCCIdentifierKey
- 61970E288A198DF838C0CF33FD39CD74C0B09B92
- IDESourceControlWCCName
- iOS-System-Services
-
-
-
-
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/kramer.xcuserdatad/UserInterfaceState.xcuserstate b/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/kramer.xcuserdatad/UserInterfaceState.xcuserstate
deleted file mode 100755
index 1ef9a6b..0000000
Binary files a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/kramer.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/kramer.xcuserdatad/WorkspaceSettings.xcsettings b/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/kramer.xcuserdatad/WorkspaceSettings.xcsettings
deleted file mode 100755
index 659c876..0000000
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/kramer.xcuserdatad/WorkspaceSettings.xcsettings
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges
-
- SnapshotAutomaticallyBeforeSignificantChanges
-
-
-
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/nick.xcuserdatad/UserInterfaceState.xcuserstate b/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/nick.xcuserdatad/UserInterfaceState.xcuserstate
deleted file mode 100755
index 705c8d5..0000000
Binary files a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/nick.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/nick.xcuserdatad/WorkspaceSettings.xcsettings b/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/nick.xcuserdatad/WorkspaceSettings.xcsettings
deleted file mode 100755
index 659c876..0000000
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/project.xcworkspace/xcuserdata/nick.xcuserdatad/WorkspaceSettings.xcsettings
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges
-
- SnapshotAutomaticallyBeforeSignificantChanges
-
-
-
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
deleted file mode 100755
index ac62168..0000000
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
deleted file mode 100644
index 8f94031..0000000
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcschemes/SystemServicesDemo.xcscheme b/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcschemes/SystemServicesDemo.xcscheme
deleted file mode 100755
index a379a29..0000000
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcschemes/SystemServicesDemo.xcscheme
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcschemes/xcschememanagement.plist b/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcschemes/xcschememanagement.plist
deleted file mode 100755
index db75307..0000000
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/kramer.xcuserdatad/xcschemes/xcschememanagement.plist
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- SchemeUserState
-
- SystemServicesDemo.xcscheme
-
- orderHint
- 0
-
-
- SuppressBuildableAutocreation
-
- 01ADF9F216051BFE008B0A6B
-
- primary
-
-
-
-
-
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/nick.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/nick.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
deleted file mode 100755
index 05301bc..0000000
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/nick.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/nick.xcuserdatad/xcschemes/SystemServicesDemo.xcscheme b/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/nick.xcuserdatad/xcschemes/SystemServicesDemo.xcscheme
deleted file mode 100755
index 68ef1b0..0000000
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/nick.xcuserdatad/xcschemes/SystemServicesDemo.xcscheme
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/nick.xcuserdatad/xcschemes/xcschememanagement.plist b/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/nick.xcuserdatad/xcschemes/xcschememanagement.plist
deleted file mode 100755
index db75307..0000000
--- a/SystemServicesDemo/SystemServicesDemo.xcodeproj/xcuserdata/nick.xcuserdatad/xcschemes/xcschememanagement.plist
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
- SchemeUserState
-
- SystemServicesDemo.xcscheme
-
- orderHint
- 0
-
-
- SuppressBuildableAutocreation
-
- 01ADF9F216051BFE008B0A6B
-
- primary
-
-
-
-
-
diff --git a/SystemServicesDemo/SystemServicesDemo/DetailViewController.h b/SystemServicesDemo/SystemServicesDemo/DetailViewController.h
deleted file mode 100644
index 203490c..0000000
--- a/SystemServicesDemo/SystemServicesDemo/DetailViewController.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// DetailViewController.h
-// SystemServicesDemo
-//
-// Created by Kramer on 10/1/13.
-// Copyright (c) 2013 Shmoopi LLC. All rights reserved.
-//
-
-#import
-
-@interface DetailViewController : UIViewController
-
-@property (nonatomic, retain) NSString *slblName, *slblPID, *slblParentID, *slblParentName, *slblPriority, *slblStartDate, *slblStatus, *slblFlags;
-
-@property (strong, nonatomic) IBOutlet UILabel *lblName;
-@property (strong, nonatomic) IBOutlet UILabel *lblPID;
-@property (strong, nonatomic) IBOutlet UILabel *lblParentID;
-@property (strong, nonatomic) IBOutlet UILabel *lblParentName;
-@property (strong, nonatomic) IBOutlet UILabel *lblPriority;
-@property (strong, nonatomic) IBOutlet UILabel *lblStartDate;
-@property (strong, nonatomic) IBOutlet UILabel *lblStatus;
-@property (strong, nonatomic) IBOutlet UILabel *lblFlags;
-
-@end
diff --git a/SystemServicesDemo/SystemServicesDemo/DetailViewController.m b/SystemServicesDemo/SystemServicesDemo/DetailViewController.m
deleted file mode 100644
index 7705b69..0000000
--- a/SystemServicesDemo/SystemServicesDemo/DetailViewController.m
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// DetailViewController.m
-// SystemServicesDemo
-//
-// Created by Kramer on 10/1/13.
-// Copyright (c) 2013 Shmoopi LLC. All rights reserved.
-//
-
-#import "DetailViewController.h"
-
-@interface DetailViewController ()
-
-@end
-
-@implementation DetailViewController
-
-@synthesize slblName, slblFlags, slblStatus, slblStartDate, slblPriority, slblParentName, slblParentID, slblPID, lblName, lblFlags, lblStatus, lblStartDate, lblPriority, lblParentName, lblParentID, lblPID;
-
-- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
-{
- self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
- if (self) {
- // Custom initialization
- }
- return self;
-}
-
-- (void)viewDidLoad
-{
- [super viewDidLoad];
- // Do any additional setup after loading the view.
-
- self.lblName.text = slblName;
- self.lblFlags.text = slblFlags;
- self.lblStatus.text = slblStatus;
- self.lblStartDate.text = slblStartDate;
- self.lblPriority.text = slblPriority;
- self.lblParentName.text = slblParentName;
- self.lblParentID.text = slblParentID;
- self.lblPID.text = slblPID;
-}
-
-- (void)didReceiveMemoryWarning
-{
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
-}
-
-@end
diff --git a/SystemServicesDemo/SystemServicesDemo/Images/Processes.png b/SystemServicesDemo/SystemServicesDemo/Images/Processes.png
deleted file mode 100644
index f927c02..0000000
Binary files a/SystemServicesDemo/SystemServicesDemo/Images/Processes.png and /dev/null differ
diff --git a/SystemServicesDemo/SystemServicesDemo/Images/Processes@2x.png b/SystemServicesDemo/SystemServicesDemo/Images/Processes@2x.png
deleted file mode 100644
index cbdacde..0000000
Binary files a/SystemServicesDemo/SystemServicesDemo/Images/Processes@2x.png and /dev/null differ
diff --git a/SystemServicesDemo/SystemServicesDemo/PCPieChart.m b/SystemServicesDemo/SystemServicesDemo/PCPieChart.m
index 87ce441..7018af2 100755
--- a/SystemServicesDemo/SystemServicesDemo/PCPieChart.m
+++ b/SystemServicesDemo/SystemServicesDemo/PCPieChart.m
@@ -1,34 +1,34 @@
/**
* Copyright (c) 2011 Muh Hon Cheng
* Created by honcheng on 28/4/11.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
* to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
+ *
+ * The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
- * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE AND NONINFRINGEMENT. IN NO EVENT
- * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR
- * IN CONNECTION WITH THE SOFTWARE OR
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
+ * WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ * PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+ * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ * IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
* @author Muh Hon Cheng
* @copyright 2011 Muh Hon Cheng
* @version
- *
+ *
*/
#import "PCPieChart.h"
@@ -70,12 +70,12 @@ - (id)initWithFrame:(CGRect)frame
if (self) {
// Initialization code
[self setBackgroundColor:[UIColor clearColor]];
-
- _titleFont = [UIFont boldSystemFontOfSize:10];
- _percentageFont = [UIFont boldSystemFontOfSize:20];
- _showArrow = YES;
- _sameColorLabel = NO;
- }
+
+ _titleFont = [UIFont boldSystemFontOfSize:10];
+ _percentageFont = [UIFont boldSystemFontOfSize:20];
+ _showArrow = YES;
+ _sameColorLabel = NO;
+ }
return self;
}
@@ -112,349 +112,409 @@ - (void)drawRect:(CGRect)rect
}
CGContextRef ctx = UIGraphicsGetCurrentContext();
- UIGraphicsPushContext(ctx);
- CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); // white color
- CGContextSetShadow(ctx, CGSizeMake(0.0f, 0.0f), margin);
- CGContextFillEllipseInRect(ctx, CGRectMake(x, y, self.diameter, self.diameter)); // a white filled circle with a diameter of 100 pixels, centered in (60, 60)
- UIGraphicsPopContext();
- CGContextSetShadow(ctx, CGSizeMake(0.0f, 0.0f), 0);
-
- float nextStartDeg = 0;
- float endDeg = 0;
- NSMutableArray *tmpComponents = [NSMutableArray array];
- int last_insert = -1;
- for (int i=0; i<[self.components count]; i++)
- {
- PCPieComponent *component = [self.components objectAtIndex:i];
- float perc = [component value]/total;
- endDeg = nextStartDeg+perc*360;
-
- CGContextSetFillColorWithColor(ctx, [component.colour CGColor]);
- CGContextMoveToPoint(ctx, origin_x, origin_y);
- CGContextAddArc(ctx, origin_x, origin_y, inner_radius, (nextStartDeg-90)*M_PI/180.0, (endDeg-90)*M_PI/180.0, 0);
- CGContextClosePath(ctx);
- CGContextFillPath(ctx);
-
- CGContextSetRGBStrokeColor(ctx, 1, 1, 1, 1);
- CGContextSetLineWidth(ctx, gap);
- CGContextMoveToPoint(ctx, origin_x, origin_y);
- CGContextAddArc(ctx, origin_x, origin_y, inner_radius, (nextStartDeg-90)*M_PI/180.0, (endDeg-90)*M_PI/180.0, 0);
- CGContextClosePath(ctx);
- CGContextStrokePath(ctx);
-
- [component setStartDeg:nextStartDeg];
- [component setEndDeg:endDeg];
- if (nextStartDeg<180)
- {
- [tmpComponents addObject:component];
- }
- else
- {
- if (last_insert==-1)
- {
- last_insert = i;
- [tmpComponents addObject:component];
- }
- else
- {
- [tmpComponents insertObject:component atIndex:last_insert];
- }
- }
-
- nextStartDeg = endDeg;
- }
-
- nextStartDeg = 0;
- endDeg = 0;
- float max_text_width = x - 10;
- for (int i=0; i<[tmpComponents count]; i++)
- {
- PCPieComponent *component = [tmpComponents objectAtIndex:i];
- nextStartDeg = component.startDeg;
- endDeg = component.endDeg;
-
- if (nextStartDeg > 180 || (nextStartDeg < 180 && endDeg> 270) )
- {
- // left
-
- // display percentage label
- if (self.sameColorLabel)
- {
- CGContextSetFillColorWithColor(ctx, [component.colour CGColor]);
- }
- else
- {
- CGContextSetRGBFillColor(ctx, 0.1f, 0.1f, 0.1f, 1.0f);
- }
- //CGContextSetRGBStrokeColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
- //CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
- CGContextSetShadow(ctx, CGSizeMake(0.0f, 0.0f), 3);
-
- //float text_x = x + 10;
- NSString *percentageText = [NSString stringWithFormat:@"%.1f%%", component.value/total*100];
- CGSize optimumSize = [percentageText sizeWithFont:self.percentageFont constrainedToSize:CGSizeMake(max_text_width,100)];
- CGRect percFrame = CGRectMake(5, left_label_y, max_text_width, optimumSize.height);
+ UIGraphicsPushContext(ctx);
+ CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); // white color
+ CGContextSetShadow(ctx, CGSizeMake(0.0f, 0.0f), margin);
+ CGContextFillEllipseInRect(ctx, CGRectMake(x, y, self.diameter, self.diameter)); // a white filled circle with a diameter of 100 pixels, centered in (60, 60)
+ UIGraphicsPopContext();
+ CGContextSetShadow(ctx, CGSizeMake(0.0f, 0.0f), 0);
- if (self.hasOutline) {
- CGContextSaveGState(ctx);
-
- CGContextSetLineWidth(ctx, 1.0f);
- CGContextSetLineJoin(ctx, kCGLineJoinRound);
- CGContextSetTextDrawingMode (ctx, kCGTextFillStroke);
- CGContextSetRGBStrokeColor(ctx, 0.2f, 0.2f, 0.2f, 0.8f);
-
- [percentageText drawInRect:percFrame withFont:self.percentageFont lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentRight];
-
- CGContextRestoreGState(ctx);
- } else {
- [percentageText drawInRect:percFrame withFont:self.percentageFont lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentRight];
+ float nextStartDeg = 0;
+ float endDeg = 0;
+ NSMutableArray *tmpComponents = [NSMutableArray array];
+ int last_insert = -1;
+ for (int i=0; i<[self.components count]; i++)
+ {
+ PCPieComponent *component = [self.components objectAtIndex:i];
+ float perc = [component value]/total;
+ endDeg = nextStartDeg+perc*360;
+
+ CGContextSetFillColorWithColor(ctx, [component.colour CGColor]);
+ CGContextMoveToPoint(ctx, origin_x, origin_y);
+ CGContextAddArc(ctx, origin_x, origin_y, inner_radius, (nextStartDeg-90)*M_PI/180.0, (endDeg-90)*M_PI/180.0, 0);
+ CGContextClosePath(ctx);
+ CGContextFillPath(ctx);
+
+ CGContextSetRGBStrokeColor(ctx, 1, 1, 1, 1);
+ CGContextSetLineWidth(ctx, gap);
+ CGContextMoveToPoint(ctx, origin_x, origin_y);
+ CGContextAddArc(ctx, origin_x, origin_y, inner_radius, (nextStartDeg-90)*M_PI/180.0, (endDeg-90)*M_PI/180.0, 0);
+ CGContextClosePath(ctx);
+ CGContextStrokePath(ctx);
+
+ [component setStartDeg:nextStartDeg];
+ [component setEndDeg:endDeg];
+ if (nextStartDeg<180)
+ {
+ [tmpComponents addObject:component];
+ }
+ else
+ {
+ if (last_insert==-1)
+ {
+ last_insert = i;
+ [tmpComponents addObject:component];
+ }
+ else
+ {
+ [tmpComponents insertObject:component atIndex:last_insert];
+ }
+ }
+
+ nextStartDeg = endDeg;
}
-
- if (self.showArrow)
- {
- // draw line to point to chart
- CGContextSetRGBStrokeColor(ctx, 0.2f, 0.2f, 0.2f, 1);
- CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
- //CGContextSetRGBStrokeColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
- //CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
- //CGContextSetShadow(ctx, CGSizeMake(0.0f, 0.0f), 5);
-
-
- int x1 = inner_radius/4*3*cos((nextStartDeg+component.value/total*360/2-90)*M_PI/180.0)+origin_x;
- int y1 = inner_radius/4*3*sin((nextStartDeg+component.value/total*360/2-90)*M_PI/180.0)+origin_y;
- CGContextSetLineWidth(ctx, 1);
- if (left_label_y + optimumSize.height/2 < y)//(left_label_y==LABEL_TOP_MARGIN)
- {
-
- CGContextMoveToPoint(ctx, 5 + max_text_width, left_label_y + optimumSize.height/2);
- CGContextAddLineToPoint(ctx, x1, left_label_y + optimumSize.height/2);
- CGContextAddLineToPoint(ctx, x1, y1);
- CGContextStrokePath(ctx);
-
- //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
- CGContextMoveToPoint(ctx, x1-ARROW_HEAD_WIDTH/2, y1);
- CGContextAddLineToPoint(ctx, x1, y1+ARROW_HEAD_LENGTH);
- CGContextAddLineToPoint(ctx, x1+ARROW_HEAD_WIDTH/2, y1);
- CGContextClosePath(ctx);
- CGContextFillPath(ctx);
-
- }
- else
- {
-
- CGContextMoveToPoint(ctx, 5 + max_text_width, left_label_y + optimumSize.height/2);
- if (left_label_y + optimumSize.height/2 > y + self.diameter)
- {
- CGContextAddLineToPoint(ctx, x1, left_label_y + optimumSize.height/2);
- CGContextAddLineToPoint(ctx, x1, y1);
- CGContextStrokePath(ctx);
-
- //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
- CGContextMoveToPoint(ctx, x1-ARROW_HEAD_WIDTH/2, y1);
- CGContextAddLineToPoint(ctx, x1, y1-ARROW_HEAD_LENGTH);
- CGContextAddLineToPoint(ctx, x1+ARROW_HEAD_WIDTH/2, y1);
- CGContextClosePath(ctx);
- CGContextFillPath(ctx);
- }
- else
- {
- float y_diff = y1 - (left_label_y + optimumSize.height/2);
- if ( (y_diff < 2*ARROW_HEAD_LENGTH && y_diff>0) || (-1*y_diff < 2*ARROW_HEAD_LENGTH && y_diff<0))
- {
-
- // straight arrow
- y1 = left_label_y + optimumSize.height/2;
-
- CGContextAddLineToPoint(ctx, x1, y1);
- CGContextStrokePath(ctx);
-
- //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
- CGContextMoveToPoint(ctx, x1, y1-ARROW_HEAD_WIDTH/2);
- CGContextAddLineToPoint(ctx, x1+ARROW_HEAD_LENGTH, y1);
- CGContextAddLineToPoint(ctx, x1, y1+ARROW_HEAD_WIDTH/2);
- CGContextClosePath(ctx);
- CGContextFillPath(ctx);
- }
- else if (left_label_y + optimumSize.height/2 180 || (nextStartDeg < 180 && endDeg> 270) )
+ {
+ // left
+
+ // display percentage label
+ if (self.sameColorLabel)
+ {
+ CGContextSetFillColorWithColor(ctx, [component.colour CGColor]);
+ }
+ else
+ {
+ CGContextSetRGBFillColor(ctx, 0.1f, 0.1f, 0.1f, 1.0f);
+ }
+ //CGContextSetRGBStrokeColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
+ //CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
+ CGContextSetShadow(ctx, CGSizeMake(0.0f, 0.0f), 3);
+
+ //float text_x = x + 10;
+ NSString *percentageText = [NSString stringWithFormat:@"%.1f%%", component.value/total*100];
+ CGRect textRect = [percentageText boundingRectWithSize:CGSizeMake(max_text_width,100)
+ options:NSStringDrawingUsesLineFragmentOrigin
+ attributes:@{
+ NSFontAttributeName:self.percentageFont,
+ NSForegroundColorAttributeName: component.colour
+ }
+ context:nil];
+ CGSize optimumSize = textRect.size;
+ CGRect percFrame = CGRectMake(5, left_label_y, max_text_width, optimumSize.height);
+
+ if (self.hasOutline) {
+ CGContextSaveGState(ctx);
+
+ CGContextSetLineWidth(ctx, 1.0f);
+ CGContextSetLineJoin(ctx, kCGLineJoinRound);
+ CGContextSetTextDrawingMode (ctx, kCGTextFillStroke);
+ CGContextSetRGBStrokeColor(ctx, 0.2f, 0.2f, 0.2f, 0.8f);
+
+ // Create the attributes
+ /// Make a copy of the default paragraph style
+ NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
+ /// Set line break mode
+ paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
+ /// Set text alignment
+ paragraphStyle.alignment = NSTextAlignmentRight;
+ [percentageText drawInRect:percFrame withAttributes:@{
+ NSFontAttributeName: self.percentageFont,
+ NSParagraphStyleAttributeName: paragraphStyle,
+ NSForegroundColorAttributeName: component.colour
+ }];
+
+ CGContextRestoreGState(ctx);
+ } else {
+ // Create the attributes
+ /// Make a copy of the default paragraph style
+ NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
+ /// Set line break mode
+ paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
+ /// Set text alignment
+ paragraphStyle.alignment = NSTextAlignmentRight;
+ [percentageText drawInRect:percFrame withAttributes:@{
+ NSFontAttributeName: self.percentageFont,
+ NSParagraphStyleAttributeName: paragraphStyle,
+ NSForegroundColorAttributeName: component.colour
+ }];
+ }
+
+ if (self.showArrow)
+ {
+ // draw line to point to chart
+ CGContextSetRGBStrokeColor(ctx, 0.2f, 0.2f, 0.2f, 1);
+ CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
+ //CGContextSetRGBStrokeColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
+ //CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
+ //CGContextSetShadow(ctx, CGSizeMake(0.0f, 0.0f), 5);
+
+
+ int x1 = inner_radius/4*3*cos((nextStartDeg+component.value/total*360/2-90)*M_PI/180.0)+origin_x;
+ int y1 = inner_radius/4*3*sin((nextStartDeg+component.value/total*360/2-90)*M_PI/180.0)+origin_y;
+ CGContextSetLineWidth(ctx, 1);
+ if (left_label_y + optimumSize.height/2 < y)//(left_label_y==LABEL_TOP_MARGIN)
+ {
+
+ CGContextMoveToPoint(ctx, 5 + max_text_width, left_label_y + optimumSize.height/2);
+ CGContextAddLineToPoint(ctx, x1, left_label_y + optimumSize.height/2);
+ CGContextAddLineToPoint(ctx, x1, y1);
+ CGContextStrokePath(ctx);
+
+ //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
+ CGContextMoveToPoint(ctx, x1-ARROW_HEAD_WIDTH/2, y1);
+ CGContextAddLineToPoint(ctx, x1, y1+ARROW_HEAD_LENGTH);
+ CGContextAddLineToPoint(ctx, x1+ARROW_HEAD_WIDTH/2, y1);
+ CGContextClosePath(ctx);
+ CGContextFillPath(ctx);
+
+ }
+ else
+ {
+
+ CGContextMoveToPoint(ctx, 5 + max_text_width, left_label_y + optimumSize.height/2);
+ if (left_label_y + optimumSize.height/2 > y + self.diameter)
+ {
+ CGContextAddLineToPoint(ctx, x1, left_label_y + optimumSize.height/2);
+ CGContextAddLineToPoint(ctx, x1, y1);
+ CGContextStrokePath(ctx);
+
+ //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
+ CGContextMoveToPoint(ctx, x1-ARROW_HEAD_WIDTH/2, y1);
+ CGContextAddLineToPoint(ctx, x1, y1-ARROW_HEAD_LENGTH);
+ CGContextAddLineToPoint(ctx, x1+ARROW_HEAD_WIDTH/2, y1);
+ CGContextClosePath(ctx);
+ CGContextFillPath(ctx);
+ }
+ else
+ {
+ float y_diff = y1 - (left_label_y + optimumSize.height/2);
+ if ( (y_diff < 2*ARROW_HEAD_LENGTH && y_diff>0) || (-1*y_diff < 2*ARROW_HEAD_LENGTH && y_diff<0))
+ {
+
+ // straight arrow
+ y1 = left_label_y + optimumSize.height/2;
+
+ CGContextAddLineToPoint(ctx, x1, y1);
+ CGContextStrokePath(ctx);
+
+ //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
+ CGContextMoveToPoint(ctx, x1, y1-ARROW_HEAD_WIDTH/2);
+ CGContextAddLineToPoint(ctx, x1+ARROW_HEAD_LENGTH, y1);
+ CGContextAddLineToPoint(ctx, x1, y1+ARROW_HEAD_WIDTH/2);
+ CGContextClosePath(ctx);
+ CGContextFillPath(ctx);
+ }
+ else if (left_label_y + optimumSize.height/20) || (-1*y_diff < 2*ARROW_HEAD_LENGTH && y_diff<0))
- {
- // straight arrow
- y1 = right_label_y + optimumSize.height/2;
-
- CGContextMoveToPoint(ctx, text_x, right_label_y + optimumSize.height/2);
- CGContextAddLineToPoint(ctx, x1, y1);
- CGContextStrokePath(ctx);
-
- //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
- CGContextMoveToPoint(ctx, x1, y1-ARROW_HEAD_WIDTH/2);
- CGContextAddLineToPoint(ctx, x1-ARROW_HEAD_LENGTH, y1);
- CGContextAddLineToPoint(ctx, x1, y1+ARROW_HEAD_WIDTH/2);
- CGContextClosePath(ctx);
- CGContextFillPath(ctx);
- }
- else if (right_label_y + optimumSize.height/2180)
- {
- // arrow point up
- y1 += ARROW_HEAD_LENGTH;
-
- CGContextMoveToPoint(ctx, text_x, right_label_y + optimumSize.height/2);
- CGContextAddLineToPoint(ctx, x1, right_label_y + optimumSize.height/2);
- CGContextAddLineToPoint(ctx, x1, y1);
- CGContextStrokePath(ctx);
-
- //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
- CGContextMoveToPoint(ctx, x1+ARROW_HEAD_WIDTH/2, y1);
- CGContextAddLineToPoint(ctx, x1, y1-ARROW_HEAD_LENGTH);
- CGContextAddLineToPoint(ctx, x1-ARROW_HEAD_WIDTH/2, y1);
- CGContextClosePath(ctx);
- CGContextFillPath(ctx);
- }
- }
- }
-
- // display title on the left
- CGContextSetRGBFillColor(ctx, 0.4f, 0.4f, 0.4f, 1.0f);
- right_label_y += optimumSize.height - 4;
- optimumSize = [component.title sizeWithFont:self.titleFont constrainedToSize:CGSizeMake(max_text_width,100)];
- CGRect titleFrame = CGRectMake(text_x, right_label_y, optimumSize.width, optimumSize.height);
- [component.title drawInRect:titleFrame withFont:self.titleFont];
- right_label_y += optimumSize.height + 10;
- }
- nextStartDeg = endDeg;
- }
+ //CGContextSetRGBStrokeColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
+ //CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
+ //CGContextSetShadow(ctx, CGSizeMake(0.0f, 0.0f), 5);
+
+ CGContextSetLineWidth(ctx, 1);
+ int x1 = inner_radius/4*3*cos((nextStartDeg+component.value/total*360/2-90)*M_PI/180.0)+origin_x;
+ int y1 = inner_radius/4*3*sin((nextStartDeg+component.value/total*360/2-90)*M_PI/180.0)+origin_y;
+
+
+ if (right_label_y + optimumSize.height/2 < y)//(right_label_y==LABEL_TOP_MARGIN)
+ {
+
+ CGContextMoveToPoint(ctx, text_x - 3, right_label_y + optimumSize.height/2);
+ CGContextAddLineToPoint(ctx, x1, right_label_y + optimumSize.height/2);
+ CGContextAddLineToPoint(ctx, x1, y1);
+ CGContextStrokePath(ctx);
+
+ //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
+ CGContextMoveToPoint(ctx, x1-ARROW_HEAD_WIDTH/2, y1);
+ CGContextAddLineToPoint(ctx, x1, y1+ARROW_HEAD_LENGTH);
+ CGContextAddLineToPoint(ctx, x1+ARROW_HEAD_WIDTH/2, y1);
+ CGContextClosePath(ctx);
+ CGContextFillPath(ctx);
+ }
+ else
+ {
+ float y_diff = y1 - (right_label_y + optimumSize.height/2);
+ if ( (y_diff < 2*ARROW_HEAD_LENGTH && y_diff>0) || (-1*y_diff < 2*ARROW_HEAD_LENGTH && y_diff<0))
+ {
+ // straight arrow
+ y1 = right_label_y + optimumSize.height/2;
+
+ CGContextMoveToPoint(ctx, text_x, right_label_y + optimumSize.height/2);
+ CGContextAddLineToPoint(ctx, x1, y1);
+ CGContextStrokePath(ctx);
+
+ //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
+ CGContextMoveToPoint(ctx, x1, y1-ARROW_HEAD_WIDTH/2);
+ CGContextAddLineToPoint(ctx, x1-ARROW_HEAD_LENGTH, y1);
+ CGContextAddLineToPoint(ctx, x1, y1+ARROW_HEAD_WIDTH/2);
+ CGContextClosePath(ctx);
+ CGContextFillPath(ctx);
+ }
+ else if (right_label_y + optimumSize.height/2180)
+ {
+ // arrow point up
+ y1 += ARROW_HEAD_LENGTH;
+
+ CGContextMoveToPoint(ctx, text_x, right_label_y + optimumSize.height/2);
+ CGContextAddLineToPoint(ctx, x1, right_label_y + optimumSize.height/2);
+ CGContextAddLineToPoint(ctx, x1, y1);
+ CGContextStrokePath(ctx);
+
+ //CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
+ CGContextMoveToPoint(ctx, x1+ARROW_HEAD_WIDTH/2, y1);
+ CGContextAddLineToPoint(ctx, x1, y1-ARROW_HEAD_LENGTH);
+ CGContextAddLineToPoint(ctx, x1-ARROW_HEAD_WIDTH/2, y1);
+ CGContextClosePath(ctx);
+ CGContextFillPath(ctx);
+ }
+ }
+ }
+
+ // display title on the left
+ CGContextSetRGBFillColor(ctx, 0.4f, 0.4f, 0.4f, 1.0f);
+ right_label_y += optimumSize.height - 4;
+ textRect = [component.title boundingRectWithSize:CGSizeMake(max_text_width,100)
+ options:NSStringDrawingUsesLineFragmentOrigin
+ attributes:@{NSFontAttributeName:self.titleFont}
+ context:nil];
+ optimumSize = textRect.size;
+ CGRect titleFrame = CGRectMake(text_x, right_label_y, optimumSize.width, optimumSize.height);
+ [component.title drawInRect:titleFrame withAttributes:@{NSFontAttributeName:self.titleFont}];
+ right_label_y += optimumSize.height + 10;
+ }
+ nextStartDeg = endDeg;
+ }
}
}
diff --git a/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoNetworkViewController.m b/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoNetworkViewController.m
index 0e141c7..266ae16 100644
--- a/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoNetworkViewController.m
+++ b/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoNetworkViewController.m
@@ -39,14 +39,11 @@ - (void)getAllNetworkInformation {
NSString *CarrierMobileNetworkCode = [NSString stringWithFormat:@"Carrier Mobile Network Code: %@",[SystemSharedServices carrierMobileNetworkCode]];
NSString *CarrierAllowsVOIP = ([SystemSharedServices carrierAllowsVOIP]) ? @"Carrier Allows VOIP: Yes" : @"Carrier Allows VOIP: No";
NSString *CurrentIPAddress = [NSString stringWithFormat:@"Current IP Address: %@",[SystemSharedServices currentIPAddress]];
- NSString *CurrentMACAddress = [NSString stringWithFormat:@"Current MAC Address: %@",[SystemSharedServices currentMACAddress]];
NSString *ExternalIPAddress = [NSString stringWithFormat:@"External IP Address: %@",[SystemSharedServices externalIPAddress]];
NSString *CellIPAddress = [NSString stringWithFormat:@"Cell IP Address: %@",[SystemSharedServices cellIPAddress]];
- NSString *CellMACAddress = [NSString stringWithFormat:@"Cell MAC Address: %@",[SystemSharedServices cellMACAddress]];
NSString *CellNetmaskAddress = [NSString stringWithFormat:@"Cell Netmask Address: %@",[SystemSharedServices cellNetmaskAddress]];
NSString *CellBroadcastAddress = [NSString stringWithFormat:@"Cell Broadcast Address: %@",[SystemSharedServices cellBroadcastAddress]];
NSString *WiFiIPAddress = [NSString stringWithFormat:@"WiFi IP Address: %@",[SystemSharedServices wiFiIPAddress]];
- NSString *WiFiMACAddress = [NSString stringWithFormat:@"WiFi MAC Address: %@",[SystemSharedServices wiFiMACAddress]];
NSString *WiFiNetmaskAddress = [NSString stringWithFormat:@"WiFi Netmask Address: %@",[SystemSharedServices wiFiNetmaskAddress]];
NSString *WiFiBroadcastAddress = [NSString stringWithFormat:@"WiFi Broadcast Address: %@",[SystemSharedServices wiFiBroadcastAddress]];
NSString *WiFiRouterAddress = [NSString stringWithFormat:@"WiFi Router Address: %@",[SystemSharedServices wiFiRouterAddress]];
@@ -54,7 +51,7 @@ - (void)getAllNetworkInformation {
NSString *ConnectedToCellNetwork = ([SystemSharedServices connectedToCellNetwork]) ? @"Connected to Cell Network: Yes" : @"Connected to Cell Network: No";
// Make an array to hold all the objects
- NSArray *array = [[NSArray alloc] initWithObjects:CarrierName, CarrierCountry, CarrierMobileCountryCode, CarrierISOCountryCode, CarrierMobileNetworkCode, CarrierAllowsVOIP, CurrentIPAddress, CurrentMACAddress, ExternalIPAddress, CellIPAddress, CellMACAddress, CellNetmaskAddress, CellBroadcastAddress, WiFiIPAddress, WiFiMACAddress, WiFiNetmaskAddress, WiFiBroadcastAddress, WiFiRouterAddress, ConnectedToWiFi, ConnectedToCellNetwork, nil];
+ NSArray *array = [[NSArray alloc] initWithObjects:CarrierName, CarrierCountry, CarrierMobileCountryCode, CarrierISOCountryCode, CarrierMobileNetworkCode, CarrierAllowsVOIP, CurrentIPAddress, ExternalIPAddress, CellIPAddress, CellNetmaskAddress, CellBroadcastAddress, WiFiIPAddress, WiFiNetmaskAddress, WiFiBroadcastAddress, WiFiRouterAddress, ConnectedToWiFi, ConnectedToCellNetwork, nil];
// Run through all the information
for (NSString *objects in array) {
diff --git a/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoProcessesViewController.h b/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoProcessesViewController.h
deleted file mode 100644
index 990fc78..0000000
--- a/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoProcessesViewController.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// SystemServicesDemoProcessesViewController.h
-// SystemServicesDemo
-//
-// Created by Kramer on 4/4/13.
-// Copyright (c) 2013 Shmoopi LLC. All rights reserved.
-//
-
-#import
-
-@interface SystemServicesDemoProcessesViewController : UITableViewController
-
-- (IBAction)refresh:(id)sender;
-
-@end
diff --git a/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoProcessesViewController.m b/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoProcessesViewController.m
deleted file mode 100644
index 62a6fdc..0000000
--- a/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoProcessesViewController.m
+++ /dev/null
@@ -1,197 +0,0 @@
-//
-// SystemServicesDemoProcessesViewController.m
-// SystemServicesDemo
-//
-// Created by Kramer on 4/4/13.
-// Copyright (c) 2013 Shmoopi LLC. All rights reserved.
-//
-
-#import "SystemServicesDemoProcessesViewController.h"
-#import "SystemServices.h"
-
-#import "DetailViewController.h"
-
-#define SystemSharedServices [SystemServices sharedServices]
-
-@interface SystemServicesDemoProcessesViewController () {
- // Make an array from all the system processes
- NSMutableArray *tableArray;
-}
-
-@end
-
-@implementation SystemServicesDemoProcessesViewController
-
-- (id)initWithStyle:(UITableViewStyle)style
-{
- self = [super initWithStyle:style];
- if (self) {
- // Custom initialization
-
- }
- return self;
-}
-
-- (void)viewDidLoad
-{
- [super viewDidLoad];
-
- [self setAutomaticallyAdjustsScrollViewInsets:NO];
- [self.tableView setContentInset:UIEdgeInsetsMake(26,0,19,0)];
-
- // Set up the tableArray;
- tableArray = [[NSMutableArray alloc] initWithArray:[SystemSharedServices processesInformation]];
-
- // Error check the array
- if (tableArray.count < 1) {
- // Invalid array
- tableArray = nil;
- tableArray = [[NSMutableArray alloc] initWithObjects:@"Unknown", nil];
- }
-
- // Uncomment the following line to preserve selection between presentations.
- // self.clearsSelectionOnViewWillAppear = NO;
-
- // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
- // self.navigationItem.rightBarButtonItem = self.editButtonItem;
-}
-
-- (void)didReceiveMemoryWarning
-{
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
-}
-
-#pragma mark - Table view data source
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
- // Return the number of sections.
- return 1;
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
- // Return the number of rows in the section.
- return tableArray.count;
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
- static NSString *CellIdentifier = @"CustomCell";
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
- if (cell == nil) {
-
- cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier];
-
- }
-
- if ([[tableArray objectAtIndex:indexPath.row] isKindOfClass:[NSDictionary class]]) {
- cell.textLabel.text = [[tableArray objectAtIndex:indexPath.row] objectForKey:@"Name"];
- }
-
- if ([[tableArray objectAtIndex:indexPath.row] isKindOfClass:[NSDictionary class]]) {
- cell.detailTextLabel.text = [[tableArray objectAtIndex:indexPath.row] objectForKey:@"PID"];
- }
-
- return cell;
-}
-
-/*
-// Override to support conditional editing of the table view.
-- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
-{
- // Return NO if you do not want the specified item to be editable.
- return YES;
-}
-*/
-
-/*
-// Override to support editing the table view.
-- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
-{
- if (editingStyle == UITableViewCellEditingStyleDelete) {
- // Delete the row from the data source
- [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
- }
- else if (editingStyle == UITableViewCellEditingStyleInsert) {
- // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
- }
-}
-*/
-
-/*
-// Override to support rearranging the table view.
-- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
-{
-}
-*/
-
-/*
-// Override to support conditional rearranging of the table view.
-- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
-{
- // Return NO if you do not want the item to be re-orderable.
- return YES;
-}
- */
-
-#pragma mark - Table view delegate
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
- // Navigation logic may go here. Create and push another view controller.
-
- // Create a dictionary from the selected cell
- NSDictionary *processData = [tableArray objectAtIndex:indexPath.row];
-
- NSString *parentProcessName;
-
- // Determine the parent process - if it's more than 0
- if ([[processData objectForKey:@"ParentID"] integerValue] > 0) {
- for (NSDictionary *dicts in tableArray) {
- if ([[dicts objectForKey:@"PID"] integerValue] == [[processData objectForKey:@"ParentID"] integerValue]) {
- // Parent process
- parentProcessName = [dicts objectForKey:@"Name"];
- break;
- }
- }
- } else if ([[processData objectForKey:@"ParentID"] integerValue] == -1) {
- parentProcessName = @"Kernel";
- } else {
- parentProcessName = @"Unknown";
- }
-
- DetailViewController *detailViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Detail"];
-
- // Set up the information on the detail view controller
- [detailViewController setTitle:[[tableArray objectAtIndex:indexPath.row] objectForKey:@"Name"]];
- // Set the labels
- [detailViewController setSlblName:[NSString stringWithFormat:@"Name: %@", [processData objectForKey:@"Name"]]];
- [detailViewController setSlblPID:[NSString stringWithFormat:@"PID: %@", [processData objectForKey:@"PID"]]];
- [detailViewController setSlblParentID:[NSString stringWithFormat:@"ParentID: %@", [processData objectForKey:@"ParentID"]]];
- [detailViewController setSlblParentName:[NSString stringWithFormat:@"Parent Name: %@", parentProcessName]];
- [detailViewController setSlblPriority:[NSString stringWithFormat:@"Priority: %@", [processData objectForKey:@"Priority"]]];
- [detailViewController setSlblStartDate:[NSString stringWithFormat:@"Start Date: %@", [processData objectForKey:@"StartDate"]]];
- [detailViewController setSlblStatus:[NSString stringWithFormat:@"Status: %@", [processData objectForKey:@"Status"]]];
- [detailViewController setSlblFlags:[NSString stringWithFormat:@"Flags: %@", [processData objectForKey:@"Flags"]]];
-
- // Pass the selected object to the new view controller.
- [self.navigationController pushViewController:detailViewController animated:YES];
-}
-
-- (IBAction)refresh:(id)sender {
- // Set up the tableArray;
- tableArray = [[NSMutableArray alloc] initWithArray:[SystemSharedServices processesInformation]];
-
- // Error check the array
- if (tableArray.count < 1) {
- // Invalid array
- tableArray = nil;
- tableArray = [[NSMutableArray alloc] initWithObjects:@"Unknown", nil];
- }
-
- // Reload the tableview
- [self.tableView reloadData];
-}
-@end
diff --git a/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoViewController.m b/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoViewController.m
index 00c6dc2..c4f3167 100755
--- a/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoViewController.m
+++ b/SystemServicesDemo/SystemServicesDemo/SystemServicesDemoViewController.m
@@ -64,11 +64,13 @@ - (void)getAllHardwareInformation {
NSString *ProximitySensorEnabled = ([SystemSharedServices proximitySensorEnabled]) ? @"Proximity Sensor: Yes" : @"Proximity Sensor: No";
NSString *DebuggerAttached = ([SystemSharedServices debuggerAttached]) ? @"Debugger Attached: Yes" : @"Debugger Attached: No";
NSString *PluggedIn = ([SystemSharedServices pluggedIn]) ? @"Plugged In: Yes" : @"Plugged In: No";
+ NSString *stepCountingAvailable = ([SystemSharedServices stepCountingAvailable]) ? @"Step Counting Available: Yes" : @"Step Counting Available: No";
+ NSString *distanceAvailable = ([SystemSharedServices distanceAvailable]) ? @"Distance Available: Yes" : @"Distance Available: No";
+ NSString *floorCountingAvailable = ([SystemSharedServices floorCountingAvailable]) ? @"Floor Counting Available: Yes" : @"Floor Counting Available: No";
NSString *Jailbroken = ([SystemSharedServices jailbroken] != NOTJAIL) ? @"Jailbroken: Yes" : @"Jailbroken: No";
NSString *NumberProcessors = [NSString stringWithFormat:@"Number of Processors: %ld", (long)[SystemSharedServices numberProcessors]];
NSString *NumberActiveProcessors = [NSString stringWithFormat:@"Number of Active Processors: %ld", (long)[SystemSharedServices numberActiveProcessors]];
- NSString *ProcessorSpeed = [NSString stringWithFormat:@"Processor Speed: %ldMhz", (long)[SystemSharedServices processorSpeed]];
- NSString *ProcessorBusSpeed = [NSString stringWithFormat:@"Processor Bus Speed: %ldMhz", (long)[SystemSharedServices processorBusSpeed]];
+ NSString *ProcessorsUsage = [NSString stringWithFormat:@"Processors Usage: %@", [SystemSharedServices processorsUsage]];
NSString *AccessoriesAttached = ([SystemSharedServices accessoriesAttached]) ? @"Accessories Attached: Yes" : @"Accessories Attached: No";
NSString *HeadphonesAttached = ([SystemSharedServices headphonesAttached]) ? @"Headphones Attached: Yes" : @"Headphones Attached: No";
NSString *NumberAttachedAccessories = [NSString stringWithFormat:@"Number of Attached Accessories: %ld", (long)[SystemSharedServices numberAttachedAccessories]];
@@ -83,12 +85,14 @@ - (void)getAllHardwareInformation {
NSString *Currency = [NSString stringWithFormat:@"Currency: %@", [SystemSharedServices currency]];
NSString *ApplicationVersion = [NSString stringWithFormat:@"Application Version: %@", [SystemSharedServices applicationVersion]];
NSString *ClipboardContent = [NSString stringWithFormat:@"ClipBoard Content: \"%@\"", [SystemSharedServices clipboardContent]];
- NSString *UniqueID = [NSString stringWithFormat:@"Unique ID: %@", [SystemSharedServices uniqueID]];
- NSString *DeviceSignature = [NSString stringWithFormat:@"Device Signature: %@", [SystemSharedServices deviceSignature]];
NSString *CFUUID = [NSString stringWithFormat:@"CFUUID: %@", [SystemSharedServices cfuuid]];
-
+
+ NSDictionary *allSystemInformation = [[SystemServices sharedServices] allSystemInformation];
+ NSAssert(![[allSystemInformation allKeys] containsObject:@"ClipboardContent"], @"We should not be including clipboard content in allSystemInformation");
+ NSAssert([[allSystemInformation allKeys] containsObject:@"ApplicationVersion"], @"We should be including application version in allSystemInformation");
+
// Make an array of all the hardware information
- NSArray *arrayofHW = [[NSArray alloc] initWithObjects:SystemUptime, DeviceModel, DeviceName, SystemName, SystemVersion, SystemDeviceTypeFormattedNO, SystemDeviceTypeFormattedYES, ScreenWidth, ScreenHeight, ScreenBrightness, MultitaskingEnabled, ProximitySensorEnabled, DebuggerAttached, PluggedIn, Jailbroken, NumberProcessors, NumberActiveProcessors, ProcessorSpeed, ProcessorBusSpeed, AccessoriesAttached, HeadphonesAttached, NumberAttachedAccessories, NameAttachedAccessories, BatteryLevel, Charging, FullyCharged, DeviceOrientation, Country, Language, TimeZone, Currency, ApplicationVersion, ClipboardContent, UniqueID, DeviceSignature, CFUUID, nil];
+ NSArray *arrayofHW = [[NSArray alloc] initWithObjects:SystemUptime, DeviceModel, DeviceName, SystemName, SystemVersion, SystemDeviceTypeFormattedNO, SystemDeviceTypeFormattedYES, ScreenWidth, ScreenHeight, ScreenBrightness, MultitaskingEnabled, ProximitySensorEnabled, DebuggerAttached, PluggedIn, stepCountingAvailable, distanceAvailable, floorCountingAvailable, Jailbroken, NumberProcessors, NumberActiveProcessors, ProcessorsUsage, AccessoriesAttached, HeadphonesAttached, NumberAttachedAccessories, NameAttachedAccessories, BatteryLevel, Charging, FullyCharged, DeviceOrientation, Country, Language, TimeZone, Currency, ApplicationVersion, ClipboardContent, CFUUID, nil];
// Run through all the information
for (NSString *objects in arrayofHW) {
diff --git a/SystemServicesDemo/SystemServicesDemo/en.lproj/MainStoryboard.storyboard b/SystemServicesDemo/SystemServicesDemo/en.lproj/MainStoryboard.storyboard
index 769d193..b766e43 100755
--- a/SystemServicesDemo/SystemServicesDemo/en.lproj/MainStoryboard.storyboard
+++ b/SystemServicesDemo/SystemServicesDemo/en.lproj/MainStoryboard.storyboard
@@ -1,8 +1,12 @@
-
-
+
+
+
+
+
-
+
+
@@ -10,20 +14,18 @@
-
+
-
-
+
+
-
-
+
-
-
+
@@ -39,27 +41,25 @@
-
+
-
+
-
-
+
+
-
-
+
-
-
+
@@ -75,7 +75,7 @@
-
+
@@ -85,33 +85,30 @@
-
-
+
-
-
+
-
+
-
Please note that the totals will not always match the hardware and that most values are just rough estimates. Memory is not exact!
@@ -120,7 +117,6 @@
-
@@ -128,7 +124,6 @@
-
@@ -136,7 +131,6 @@
-
@@ -144,7 +138,6 @@
-
@@ -152,7 +145,6 @@
-
@@ -160,7 +152,6 @@
-
@@ -168,14 +159,12 @@
-
-
-
+
@@ -197,20 +186,19 @@
-
+
-
+
-
@@ -218,7 +206,6 @@
-
@@ -226,14 +213,12 @@
-
-
-
+
@@ -251,168 +236,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -421,7 +245,6 @@
-
@@ -429,7 +252,7 @@
-
+
@@ -438,7 +261,6 @@
-
@@ -446,7 +268,7 @@
-
+
@@ -455,7 +277,6 @@
-
@@ -463,7 +284,7 @@
-
+
@@ -472,7 +293,6 @@
-
@@ -480,7 +300,7 @@
-
+
@@ -488,6 +308,5 @@
-