├── .gitignore ├── Podfile ├── Podfile.lock ├── README.md ├── iSystantMonitorFramework ├── HLSystemMonitor │ ├── HLBatteryMonitor │ │ ├── HLBatteryMonitor.h │ │ └── HLBatteryMonitor.m │ ├── HLCPUMonitor │ │ ├── HLCPUMonitor.h │ │ ├── HLCPUMonitor.m │ │ └── cpuFreq.s │ ├── HLDeviceInformation │ │ ├── HLDeviceInformation.h │ │ └── HLDeviceInformation.m │ ├── HLMemoryMonitor │ │ ├── HLMemoryMonitor.h │ │ └── HLMemoryMonitor.m │ ├── HLNetworkMonitor │ │ ├── HLNetworkMonitor.h │ │ └── HLNetworkMonitor.m │ ├── HLSystemMonitor.h │ ├── HLSystemMonitor.m │ └── devices.json ├── Info.plist └── iSystantMonitorFramework.h ├── iSystantMonitorFrameworkTests ├── Info.plist └── iSystantMonitorFrameworkTests.m ├── kajslkd.xcodeproj ├── project.pbxproj └── xcshareddata │ └── xcschemes │ └── kajslkd.xcscheme ├── kajslkd.xcworkspace └── xcshareddata │ └── WorkspaceSettings.xcsettings ├── kajslkd ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-83.5@2x.png │ │ ├── Icon-Notification.png │ │ ├── Icon-Notification@2x.png │ │ ├── Icon-Notification@3x.png │ │ ├── Icon-Small-40.png │ │ ├── Icon-Small-40@2x.png │ │ ├── Icon-Small-40@3x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ ├── icon.png │ │ ├── icon_128x128.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_16x16.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_256x256.png │ │ ├── icon_256x256@2x.png │ │ ├── icon_32x32.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_512x512.png │ │ └── icon_512x512@2x.png │ ├── Contents.json │ ├── Day │ │ ├── Contents.json │ │ ├── icon_battery_normal.imageset │ │ │ ├── Contents.json │ │ │ └── icon_battery_normal@2x.png │ │ ├── icon_cpu_normal.imageset │ │ │ ├── Contents.json │ │ │ └── icon_cpu_normal@2x.png │ │ ├── icon_memory_normal.imageset │ │ │ ├── Contents.json │ │ │ └── icon_memory_normal@2x.png │ │ ├── icon_network_normal.imageset │ │ │ ├── Contents.json │ │ │ └── icon_network_normal@2x.png │ │ ├── icon_setting_normal.imageset │ │ │ ├── Contents.json │ │ │ └── setting_select@2x.png │ │ └── icon_storage_normal.imageset │ │ │ ├── Contents.json │ │ │ └── icon_storage_normal@2x.png │ ├── Icon-60.imageset │ │ ├── Contents.json │ │ ├── Icon-60@2x.png │ │ └── Icon-60@3x.png │ ├── Night │ │ ├── Contents.json │ │ ├── battery_night.imageset │ │ │ ├── Contents.json │ │ │ └── battery@2x.png │ │ ├── cpu_night.imageset │ │ │ ├── Contents.json │ │ │ └── cpu@2x.png │ │ ├── icon_setting_night.imageset │ │ │ ├── Contents.json │ │ │ └── setting_unselect@2x.png │ │ ├── memory_night.imageset │ │ │ ├── Contents.json │ │ │ └── memory@2x.png │ │ ├── menu_night.imageset │ │ │ ├── Contents.json │ │ │ └── menu.png │ │ ├── network_night.imageset │ │ │ ├── Contents.json │ │ │ └── network.png │ │ ├── refresh_icon_night.imageset │ │ │ ├── Contents.json │ │ │ └── refresh_icon.png │ │ ├── setting_night.imageset │ │ │ ├── Contents.json │ │ │ └── setting.png │ │ └── storage_night.imageset │ │ │ ├── Contents.json │ │ │ └── storage.png │ ├── download.imageset │ │ ├── Contents.json │ │ └── download.png │ └── upload.imageset │ │ ├── Contents.json │ │ └── upload.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Class │ ├── Cell │ │ ├── HLBatteryCell.h │ │ ├── HLBatteryCell.m │ │ ├── HLCPUCell.h │ │ ├── HLCPUCell.m │ │ ├── HLDetailTableViewCell.h │ │ ├── HLDetailTableViewCell.m │ │ ├── HLDeviceCell.h │ │ ├── HLDeviceCell.m │ │ ├── HLMemoryCell.h │ │ ├── HLMemoryCell.m │ │ ├── HLNetworkCell.h │ │ ├── HLNetworkCell.m │ │ ├── HLStorageCell.h │ │ └── HLStorageCell.m │ ├── HLCellViewModel.h │ ├── HLCellViewModel.m │ └── ViewController │ │ ├── Detail │ │ ├── HLCPUDetailViewController.h │ │ ├── HLCPUDetailViewController.m │ │ ├── HLNetworkDetailViewController.h │ │ ├── HLNetworkDetailViewController.m │ │ ├── HLPhoneDetailViewController.h │ │ ├── HLPhoneDetailViewController.m │ │ ├── HLRAMDetailViewController.h │ │ └── HLRAMDetailViewController.m │ │ ├── HLDeviceViewController.h │ │ ├── HLDeviceViewController.m │ │ ├── HLPrivacyViewController.h │ │ ├── HLPrivacyViewController.m │ │ ├── HLSettingViewController.h │ │ └── HLSettingViewController.m ├── Common │ ├── Base │ │ ├── HLBaseNavViewController.h │ │ ├── HLBaseNavViewController.m │ │ ├── HLBaseTableViewCell.h │ │ ├── HLBaseTableViewCell.m │ │ ├── HLBaseTableViewController.h │ │ ├── HLBaseTableViewController.m │ │ ├── HLBaseTableViewProtocol.h │ │ ├── HLBaseViewController.h │ │ ├── HLBaseViewController.m │ │ ├── HLTabBarController.h │ │ └── HLTabBarController.m │ ├── Category │ │ ├── CALayer+Extension.h │ │ ├── CALayer+Extension.m │ │ ├── UIColor+Extension.h │ │ ├── UIColor+Extension.m │ │ ├── UINavigationBar+Awesome.h │ │ ├── UINavigationBar+Awesome.m │ │ ├── UIView+Extension.h │ │ ├── UIView+Extension.m │ │ ├── UIViewController+Extension.h │ │ └── UIViewController+Extension.m │ ├── HLMacros.h │ └── HLPrivacyPolicy │ │ ├── HLPrivacyPolicy.h │ │ └── HLPrivacyPolicy.m ├── Info.plist ├── PrefixHeader.pch ├── SceneDelegate.h ├── SceneDelegate.m ├── Vendor │ ├── HLFeedBack │ │ ├── HLFeedback.h │ │ └── HLFeedback.m │ ├── HLLabel │ │ ├── HLLabel.h │ │ └── HLLabel.m │ ├── HLProgressView.h │ └── HLProgressView.m ├── en.lproj │ ├── Localizable.strings │ └── Main.strings ├── iSystant Lite.entitlements ├── iSystant LiteDebug.entitlements ├── main.m ├── theme.txt └── zh-Hans.lproj │ ├── LaunchScreen.strings │ ├── Localizable.strings │ └── Main.strings ├── resource ├── 0x0ss-P3.jpg └── 0x0ss-P3_dark.jpg └── sysmonitorTodayExt ├── Base.lproj └── MainInterface.storyboard ├── Info.plist ├── TodayViewController.h ├── TodayViewController.m └── iSystant LiteDebug.entitlements /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | Pods/ 34 | 35 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '10.0' 3 | 4 | target 'kajslkd' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | #use_frameworks! 7 | 8 | # Pods for kajslkd 9 | pod 'AAChartKit' 10 | pod 'Masonry' 11 | pod 'DKNightVersion' 12 | pod 'AppCenter' 13 | 14 | end 15 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AAChartKit (4.0.0) 3 | - AppCenter (2.5.1): 4 | - AppCenter/Analytics (= 2.5.1) 5 | - AppCenter/Crashes (= 2.5.1) 6 | - AppCenter/Analytics (2.5.1): 7 | - AppCenter/Core 8 | - AppCenter/Core (2.5.1) 9 | - AppCenter/Crashes (2.5.1): 10 | - AppCenter/Core 11 | - DKNightVersion (2.4.3): 12 | - DKNightVersion/Core (= 2.4.3) 13 | - DKNightVersion/CoreAnimation (= 2.4.3) 14 | - DKNightVersion/UIKit (= 2.4.3) 15 | - DKNightVersion/Core (2.4.3): 16 | - DKNightVersion/Core/DeallocBlockExecutor (= 2.4.3) 17 | - DKNightVersion/Core/extobjc (= 2.4.3) 18 | - DKNightVersion/Core/DeallocBlockExecutor (2.4.3) 19 | - DKNightVersion/Core/extobjc (2.4.3) 20 | - DKNightVersion/CoreAnimation (2.4.3): 21 | - DKNightVersion/Core 22 | - DKNightVersion/UIKit (2.4.3): 23 | - DKNightVersion/Core 24 | - Masonry (1.1.0) 25 | 26 | DEPENDENCIES: 27 | - AAChartKit 28 | - AppCenter 29 | - DKNightVersion 30 | - Masonry 31 | 32 | SPEC REPOS: 33 | https://github.com/CocoaPods/Specs.git: 34 | - AAChartKit 35 | - AppCenter 36 | - DKNightVersion 37 | - Masonry 38 | 39 | SPEC CHECKSUMS: 40 | AAChartKit: a62caf524117fcf19e7c8b4f10acbf58dcb08359 41 | AppCenter: fddcbac6e4baae3d93a196ceb0bfe0e4ce407dec 42 | DKNightVersion: eaa80cc4014b4bae7d4b535fd87ecc6a3c2767b3 43 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 44 | 45 | PODFILE CHECKSUM: 50aad91d1fc3191320153010405c5d6333d18548 46 | 47 | COCOAPODS: 1.8.4 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iSystant 2 | A useful system utilitor to see cpu,RAM, network speed and your real rest battery. 3 | 4 | It's a fully iOS app with today extension, dark/light mode. 5 | 6 | 7 | - Device information: phone model, screen pixel size, system version, etc. 8 | - CPU: architecture, cores, CPU utilization, GPU, benchmark ,etc. 9 | - Memory: visually see the current memory state of the phone. 10 | - Network: get WiFi name, IP address, DNS, real-time up/down network speed, cellular data traffic and WiFi traffic. 11 | - Storage: free storage volume, used volume. 12 | - Battery life: real rest battery volume. 13 | 14 | 15 | 16 | ![](/resource/0x0ss-P3.jpg) 17 | 18 | ![](/resource/0x0ss-P3_dark.jpg) 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/HLSystemMonitor/HLBatteryMonitor/HLBatteryMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLBatteryMonitor.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/10/24. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLBatteryMonitor : NSObject 14 | 15 | #pragma mark - 电池信息 16 | /// 获取电池电量 17 | + (NSString *)getBatteryLevel; 18 | /// 获取电池当前的状态,共有4种状态 19 | + (NSString *)getBatteryState; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/HLSystemMonitor/HLBatteryMonitor/HLBatteryMonitor.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLBatteryMonitor.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/10/24. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLBatteryMonitor.h" 10 | #import 11 | 12 | @implementation HLBatteryMonitor 13 | 14 | #pragma mark - 电池信息 15 | 16 | /// 获取电池电量 17 | + (NSString *)getBatteryLevel { 18 | NSUserDefaults * group = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.redefine.iSystantPro"]; 19 | [group setFloat:[UIDevice currentDevice].batteryLevel forKey:@"batteryLevel"]; 20 | return [NSString stringWithFormat:@"%0.f %%", [UIDevice currentDevice].batteryLevel*100]; 21 | } 22 | 23 | /// 获取电池当前的状态,共有4种状态 24 | + (NSString *) getBatteryState { 25 | UIDevice *device = [UIDevice currentDevice]; 26 | if (device.batteryState == UIDeviceBatteryStateUnknown) { 27 | return NSLocalizedString(@"UnKnow", nil); 28 | } else if (device.batteryState == UIDeviceBatteryStateUnplugged){ 29 | return NSLocalizedString(@"Unplugged", nil); 30 | } else if (device.batteryState == UIDeviceBatteryStateCharging){ 31 | return NSLocalizedString(@"Charging", nil); 32 | } else if (device.batteryState == UIDeviceBatteryStateFull){ 33 | return NSLocalizedString(@"Full", nil); 34 | } 35 | return nil; 36 | } 37 | 38 | /// 获取精准电池电量,通过获取statusBar上的电池视图的值...这种方式已经不能用于iPhone X等刘海屏,需要适配 39 | //+ (float)getCurrentBatteryLevel { 40 | // UIApplication *app = [UIApplication sharedApplication]; 41 | // if (app.applicationState == UIApplicationStateActive||app.applicationState==UIApplicationStateInactive) { 42 | // Ivar ivar= class_getInstanceVariable([app class],"_statusBar"); 43 | // id status = object_getIvar(app, ivar); 44 | // for (id aview in [status subviews]) { 45 | // int batteryLevel = 0; 46 | // for (id bview in [aview subviews]) { 47 | // if ([NSStringFromClass([bview class]) caseInsensitiveCompare:@"UIStatusBarBatteryItemView"] == NSOrderedSame&&[[[UIDevice currentDevice] systemVersion] floatValue] >=6.0) { 48 | // 49 | // Ivar ivar= class_getInstanceVariable([bview class],"_capacity"); 50 | // if(ivar) { 51 | // batteryLevel = ((int (*)(id, Ivar))object_getIvar)(bview, ivar); 52 | // if (batteryLevel > 0 && batteryLevel <= 100) { 53 | // return batteryLevel; 54 | // 55 | // } else { 56 | // return 0; 57 | // } 58 | // } 59 | // } 60 | // } 61 | // } 62 | // } 63 | // 64 | // return 0; 65 | //} 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/HLSystemMonitor/HLCPUMonitor/HLCPUMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLCPUMonitor.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/10/23. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern int freqTest(int cycles); 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface HLCPUMonitor : NSObject 16 | 17 | @property (nonatomic, assign) NSTimeInterval refreshInterval;//刷新频率 18 | 19 | /// CPU实时频率 20 | @property (nonatomic, strong) NSString *realtimeCpuFreq; 21 | 22 | /// 当前App的cpu使用率 23 | @property (nonatomic, strong) NSString *appCPUUsage; 24 | /// 系统CPU使用率 25 | @property (nonatomic, copy) NSString *systemCPUUsage; 26 | /// 用户态CPU使用率 27 | @property (nonatomic, copy) NSString *userCPUUsage; 28 | /// 空闲态CPU使用率 29 | @property (nonatomic, copy) NSString *idleCPUUsage; 30 | @property (nonatomic, copy) NSString *cpuMaxFrequency; 31 | @property (nonatomic, copy) NSString *cpuMinFrequency; 32 | 33 | /// CPU架构:iphone8->ARM64 V8 34 | @property (nonatomic, copy) NSString *cpuSubtypeString; 35 | /// CPU核数 : 6核 36 | @property (nonatomic, assign) NSUInteger cpuNumber; 37 | 38 | + (instancetype)monitor; 39 | 40 | //- (void)start:(NSTimeInterval)interval; 41 | //- (void)stop; 42 | - (NSDecimalNumber *)rawCPUValue:(NSString *)value; 43 | @end 44 | 45 | NS_ASSUME_NONNULL_END 46 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/HLSystemMonitor/HLCPUMonitor/cpuFreq.s: -------------------------------------------------------------------------------- 1 | // 2 | // cpuFreq.s 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/10/27. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | .text 10 | .text 11 | .align 4 12 | .globl _freqTest 13 | 14 | _freqTest: 15 | 16 | // STP x4, x5, [sp, #16 * 0] 17 | // STP x6, x7, [sp, #16 * 1] 18 | // STP x8, x9, [sp, #16 * 2] 19 | // STP x10, x11, [sp, #16 * 3] 20 | 21 | // freqTest_LOOP: 22 | 23 | // //loop 1 24 | // add x2, x2, x1 25 | // add x3, x3, x2 26 | // add x4, x4, x3 27 | // add x5, x5, x4 28 | // add x6, x6, x5 29 | // add x7, x7, x6 30 | // add x8, x8, x7 31 | // add x9, x9, x8 32 | // add x10, x10, x9 33 | // add x11, x11, x10 34 | // add x12, x12, x11 35 | // add x14, x14, x12 36 | // add x1, x1, x14 37 | 38 | // //loop 2 39 | // add x2, x2, x1 40 | // add x3, x3, x2 41 | // add x4, x4, x3 42 | // add x5, x5, x4 43 | // add x6, x6, x5 44 | // add x7, x7, x6 45 | // add x8, x8, x7 46 | // add x9, x9, x8 47 | // add x10, x10, x9 48 | // add x11, x11, x10 49 | // add x12, x12, x11 50 | // add x14, x14, x12 51 | // add x1, x1, x14 52 | 53 | // //loop 3 54 | // add x2, x2, x1 55 | // add x3, x3, x2 56 | // add x4, x4, x3 57 | // add x5, x5, x4 58 | // add x6, x6, x5 59 | // add x7, x7, x6 60 | // add x8, x8, x7 61 | // add x9, x9, x8 62 | // add x10, x10, x9 63 | // add x11, x11, x10 64 | // add x12, x12, x11 65 | // add x14, x14, x12 66 | // add x1, x1, x14 67 | 68 | // //loop 4 69 | // add x2, x2, x1 70 | // add x3, x3, x2 71 | // add x4, x4, x3 72 | // add x5, x5, x4 73 | // add x6, x6, x5 74 | // add x7, x7, x6 75 | // add x8, x8, x7 76 | // add x9, x9, x8 77 | // add x10, x10, x9 78 | // add x11, x11, x10 79 | // add x12, x12, x11 80 | // add x14, x14, x12 81 | // add x1, x1, x14 82 | 83 | // //loop 5 84 | // add x2, x2, x1 85 | // add x3, x3, x2 86 | // add x4, x4, x3 87 | // add x5, x5, x4 88 | // add x6, x6, x5 89 | // add x7, x7, x6 90 | // add x8, x8, x7 91 | // add x9, x9, x8 92 | // add x10, x10, x9 93 | // add x11, x11, x10 94 | // add x12, x12, x11 95 | // add x14, x14, x12 96 | // add x1, x1, x14 97 | 98 | // //loop 6 99 | // add x2, x2, x1 100 | // add x3, x3, x2 101 | // add x4, x4, x3 102 | // add x5, x5, x4 103 | // add x6, x6, x5 104 | // add x7, x7, x6 105 | // add x8, x8, x7 106 | // add x9, x9, x8 107 | // add x10, x10, x9 108 | // add x11, x11, x10 109 | // add x12, x12, x11 110 | // add x14, x14, x12 111 | // add x1, x1, x14 112 | 113 | // //loop 7 114 | // add x2, x2, x1 115 | // add x3, x3, x2 116 | // add x4, x4, x3 117 | // add x5, x5, x4 118 | // add x6, x6, x5 119 | // add x7, x7, x6 120 | // add x8, x8, x7 121 | // add x9, x9, x8 122 | // add x10, x10, x9 123 | // add x11, x11, x10 124 | // add x12, x12, x11 125 | // add x14, x14, x12 126 | // add x1, x1, x14 127 | 128 | // //loop 8 129 | // add x2, x2, x1 130 | // add x3, x3, x2 131 | // add x4, x4, x3 132 | // add x5, x5, x4 133 | // add x6, x6, x5 134 | // add x7, x7, x6 135 | // add x8, x8, x7 136 | // add x9, x9, x8 137 | // add x10, x10, x9 138 | // add x11, x11, x10 139 | // add x12, x12, x11 140 | // add x14, x14, x12 141 | // add x1, x1, x14 142 | 143 | // //loop 9 144 | // add x2, x2, x1 145 | // add x3, x3, x2 146 | // add x4, x4, x3 147 | // add x5, x5, x4 148 | // add x6, x6, x5 149 | // add x7, x7, x6 150 | // add x8, x8, x7 151 | // add x9, x9, x8 152 | // add x10, x10, x9 153 | // add x11, x11, x10 154 | // add x12, x12, x11 155 | // add x14, x14, x12 156 | // add x1, x1, x14 157 | 158 | // //loop 10 159 | // add x2, x2, x1 160 | // add x3, x3, x2 161 | // add x4, x4, x3 162 | // add x5, x5, x4 163 | // add x6, x6, x5 164 | // add x7, x7, x6 165 | // add x8, x8, x7 166 | // add x9, x9, x8 167 | // add x10, x10, x9 168 | // add x11, x11, x10 169 | // add x12, x12, x11 170 | // add x14, x14, x12 171 | // add x1, x1, x14 172 | 173 | // subs x0, x0, #1 174 | // bne freqTest_LOOP 175 | 176 | // RET 177 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/HLSystemMonitor/HLDeviceInformation/HLDeviceInformation.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLDeviceInformation.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/10/21. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HLNetworkMonitor.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface HLDeviceInformation : NSObject 15 | 16 | @property (nonatomic, strong) NSDictionary *deviceDict; 17 | 18 | @property (nonatomic, strong) NSString *bootTime;//设备启动日期 19 | @property (nonatomic, strong) NSString *upTime;//启动持续天数 20 | 21 | + (instancetype)sharedInstance; 22 | #pragma mark - 设备信息 23 | /// 屏幕宽度 24 | + (NSString *)getDeviceScreenWidth; 25 | /// 屏幕高度 26 | + (NSString *)getDeviceScreenHeight; 27 | /// 屏幕像素 28 | + (NSString *)getDevicePixels; 29 | /// 获取设备型号:iphone8 的model是 iphone10,1 30 | + (NSString *)getDeviceModel; 31 | /// 获取设备系列名称 如iPhone8, iPhone XS 32 | + (NSString *)getDeviceName; 33 | /// 获取iPhone名称,用户自己设置的手机名称 34 | + (NSString *)getiPhoneName; 35 | /// 获取app版本号 36 | + (NSString *)getAPPVerion; 37 | /// 当前系统名称 38 | + (NSString *)getSystemName; 39 | /// 当前系统版本号 40 | + (NSString *)getSystemVersion; 41 | /// 当前系统build号 42 | + (NSString *)getSystemBuildVersion; 43 | /// 通用唯一识别码UUID 44 | + (NSString *)getUUID; 45 | /// 获取当前语言 46 | + (NSString *)getDeviceLanguage; 47 | /// 获取系统运行时间 48 | - (void)getSystemUpTime; 49 | #pragma mark - 磁盘存储信息 50 | 51 | + (NSDictionary *)getDeviceSize;// 52 | 53 | + (NSString *)getTimezone; 54 | @end 55 | 56 | NS_ASSUME_NONNULL_END 57 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/HLSystemMonitor/HLMemoryMonitor/HLMemoryMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLMemoryMonitor.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/10/23. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLMemoryMonitor : NSObject 14 | 15 | @property (nonatomic, assign) uint8_t refreshInterval;//刷新频率 16 | 17 | /** 18 | 系统总内存 19 | */ 20 | @property (nonatomic, strong) NSString *totalMemory; 21 | 22 | /** 23 | 系统已用内存 24 | */ 25 | @property (nonatomic, strong) NSString *totalUsedMemory; 26 | 27 | /** 28 | 系统可用内存 29 | */ 30 | @property (nonatomic, strong) NSString *totalAvaliableMemory; 31 | 32 | /** 33 | 联动内存 34 | */ 35 | @property (nonatomic, strong,getter=wiredMemory) NSString *wiredMemory; 36 | /** 37 | 活跃内存 38 | */ 39 | @property (nonatomic, strong,getter=activeMemory) NSString *activeMemory; 40 | /** 41 | 空闲内存 42 | */ 43 | @property (nonatomic, strong,getter=freeMemory) NSString *freeMemory; 44 | /** 45 | 不活跃内存 46 | */ 47 | @property (nonatomic, strong,getter=inactiveMemory) NSString *inactiveMemory; 48 | 49 | /** 50 | App使用内存 51 | */ 52 | @property (nonatomic, strong) NSString *appMemoryUsage; 53 | 54 | 55 | /** 56 | 其他内存 57 | */ 58 | @property (nonatomic, assign) CGFloat otherMemory; 59 | 60 | /** 61 | 内存使用率 62 | */ 63 | @property (nonatomic, assign) Float64 memoryUsagePercentage; 64 | 65 | + (instancetype)monitor; 66 | 67 | - (void)start:(NSTimeInterval)interval; 68 | 69 | - (void)stop; 70 | 71 | - (CGFloat )rawMemoryValue:(NSString *)value; 72 | 73 | @end 74 | 75 | NS_ASSUME_NONNULL_END 76 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/HLSystemMonitor/HLMemoryMonitor/HLMemoryMonitor.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLMemoryMonitor.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/10/23. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLMemoryMonitor.h" 10 | #import 11 | 12 | @implementation HLMemoryMonitor 13 | { 14 | long long _totalMemory_; 15 | long long _availableMemory_; 16 | long long _usedMemory_; 17 | long long _freeMemory_; 18 | long long _wiredMemory_; 19 | long long _activeMemory_; 20 | long long _inactiveMemory_; 21 | long long _appMemoryUsage_; 22 | NSTimer *_timer; 23 | NSTimeInterval _interval; 24 | 25 | } 26 | + (instancetype)monitor { 27 | static dispatch_once_t onceToken; 28 | static HLMemoryMonitor *monitor = nil; 29 | dispatch_once(&onceToken, ^{ 30 | monitor = [[HLMemoryMonitor alloc] init]; 31 | monitor.refreshInterval = 5;// 默认5秒刷新频率 32 | }); 33 | return monitor; 34 | } 35 | 36 | - (void)start:(NSTimeInterval)interval{ 37 | [self getTotalMemorySize]; 38 | 39 | [self needToRefresh]; 40 | _interval = interval; 41 | if (_timer == nil) { 42 | _timer = [NSTimer scheduledTimerWithTimeInterval:_interval target:self selector:@selector(needToRefresh) userInfo:nil repeats:YES]; 43 | [[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes]; 44 | [_timer fire]; 45 | } 46 | } 47 | - (void)stop{ 48 | if ([_timer isValid]) { 49 | [_timer invalidate]; 50 | _timer = nil; 51 | } 52 | } 53 | 54 | - (void)needToRefresh { 55 | [self getAvailableMemorySize]; 56 | [self getUsedMemorySize]; 57 | [self currentAppMemoryUsageSize]; 58 | [self getMemoryUsagePercentage]; 59 | } 60 | 61 | - (CGFloat )rawMemoryValue:(NSString *)value { 62 | if ([value containsString:@"GB"]) { 63 | return [[value stringByReplacingOccurrencesOfString:@"GB" withString:@""] floatValue]*1024; 64 | } 65 | return [[value stringByReplacingOccurrencesOfString:@"MB" withString:@""] floatValue]; 66 | } 67 | #pragma mark - Public 68 | /// 获取总内存大小 69 | - (void)getTotalMemorySize { 70 | self.totalMemory = [self convertUnits:[self getTotalMemory]]; 71 | } 72 | 73 | - (void)getAvailableMemorySize { 74 | self.totalAvaliableMemory = [self convertUnits:[self getAvailableMemory]]; 75 | } 76 | 77 | - (void)getUsedMemorySize { 78 | self.totalUsedMemory = [self convertUnits:[self getUsedMemory]]; 79 | } 80 | 81 | - (void)currentAppMemoryUsageSize { 82 | self.appMemoryUsage = [self convertUnits:[self currentAppMemoryUsage]]; 83 | } 84 | 85 | - (void)getMemoryUsagePercentage { 86 | float a = [NSNumber numberWithLongLong:_usedMemory_].floatValue; 87 | uint64_t b = _totalMemory_; 88 | NSString *percentage = [NSString stringWithFormat:@"%0.3f",a/b]; 89 | self.memoryUsagePercentage = percentage.floatValue ; 90 | } 91 | 92 | - (NSString *)freeMemory { 93 | return [self convertUnits:_freeMemory_]; 94 | } 95 | - (NSString *)inactiveMemory { 96 | return [self convertUnits:_inactiveMemory_]; 97 | } 98 | - (NSString *)wiredMemory { 99 | return [self convertUnits:_wiredMemory_]; 100 | } 101 | - (NSString *)activeMemory { 102 | return [self convertUnits:_activeMemory_]; 103 | } 104 | 105 | - (CGFloat)otherMemory { 106 | return (_totalMemory_ - _freeMemory_ - _inactiveMemory_ - _wiredMemory_ - _activeMemory_ - _appMemoryUsage_)/1024/1024; 107 | } 108 | #pragma mark - Private 109 | - (long long)getTotalMemory { 110 | _totalMemory_ = [NSProcessInfo processInfo].physicalMemory; 111 | return _totalMemory_; 112 | } 113 | 114 | /// 获取当前可用内存: free_count空闲内存+inactive_count非活跃内存 115 | - (long long)getAvailableMemory { 116 | vm_statistics_data_t vmStats; 117 | mach_msg_type_number_t infoCount = HOST_VM_INFO_COUNT; 118 | kern_return_t kernReturn = host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&vmStats, &infoCount); 119 | if (kernReturn != KERN_SUCCESS) 120 | { 121 | return NSNotFound; 122 | } 123 | _freeMemory_ = vm_page_size * vmStats.free_count; 124 | _inactiveMemory_ = vm_page_size * vmStats.inactive_count; 125 | _availableMemory_ = _freeMemory_ + _inactiveMemory_;//MB 126 | return _availableMemory_/1024*1024; 127 | } 128 | 129 | /// 获取当前已用内存: wire_count绑定内存+active_count活跃内存 130 | - (long long)getUsedMemory { 131 | vm_statistics_data_t vmStats; 132 | mach_msg_type_number_t infoCount = HOST_VM_INFO_COUNT; 133 | kern_return_t kernReturn = host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&vmStats, &infoCount); 134 | if (kernReturn != KERN_SUCCESS) 135 | { 136 | return NSNotFound; 137 | } 138 | _wiredMemory_ = vm_page_size * vmStats.wire_count; 139 | _activeMemory_ = vm_page_size * vmStats.active_count; 140 | _usedMemory_ = _wiredMemory_ + _activeMemory_; 141 | return _usedMemory_; 142 | } 143 | 144 | /// 计算当前应用占用的内存大小 145 | - (int64_t)currentAppMemoryUsage { 146 | // struct mach_task_basic_info info;//有些用的是这个,后面可以测试一下结果 147 | int64_t memoryUsageInByte = 0; 148 | task_vm_info_data_t vmInfo; 149 | mach_msg_type_number_t count = TASK_VM_INFO_COUNT; 150 | kern_return_t kernelReturn = task_info(mach_task_self(), TASK_VM_INFO, (task_info_t) &vmInfo, &count); 151 | if(kernelReturn == KERN_SUCCESS) { 152 | memoryUsageInByte = (int64_t) vmInfo.phys_footprint; 153 | //NSLog(@"Memory in use (in bytes): %lld", memoryUsageInByte); 154 | } else { 155 | NSLog(@"Error with task_info(): %s", mach_error_string(kernelReturn)); 156 | } 157 | _appMemoryUsage_ = memoryUsageInByte; 158 | return memoryUsageInByte; 159 | } 160 | 161 | - (NSString *)convertUnits:(long long)size 162 | { 163 | double doublesize = [NSNumber numberWithLongLong:size].doubleValue; 164 | if (doublesize>1024*1024*1024){ 165 | return [NSString stringWithFormat:@"%.2fGB",doublesize/1024/1024/1024];//大于1G,则转化成G单位的字符串 166 | } 167 | else if(doublesize<1024*1024*1024&&doublesize>=1024*1024)//大于1M,则转化成M单位的字符串 168 | { 169 | return [NSString stringWithFormat:@"%.2fMB",doublesize/1024/1024]; 170 | } 171 | else if(doublesize>=1024&&doublesize<1024*1024) //不到1M,但是超过了1KB,则转化成KB单位 172 | { 173 | return [NSString stringWithFormat:@"%.2fKB",doublesize/1024]; 174 | } 175 | else//剩下的都是小于1K的,则转化成B单位 176 | { 177 | return [NSString stringWithFormat:@"%.2fB",doublesize]; 178 | } 179 | } 180 | 181 | @end 182 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/HLSystemMonitor/HLNetworkMonitor/HLNetworkMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLNetworkMonitor.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/10/23. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | // 88kB/s 11 | extern NSString *const GSDownloadNetworkSpeedNotificationKey; 12 | // 2MB/s 13 | extern NSString *const GSUploadNetworkSpeedNotificationKey; 14 | 15 | 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @interface HLNetworkMonitor : NSObject 20 | 21 | 22 | /// WIFI/4G/3G 23 | @property (nonatomic, copy) NSString *networkType; 24 | @property (nonatomic, copy) NSString *publicIp; 25 | @property (nonatomic, copy) NSString *internalIp; 26 | @property (nonatomic, copy) NSString *wifiName; 27 | @property (nonatomic, copy) NSString *wifiMacAddress; 28 | @property (nonatomic, copy) NSString *dns; 29 | 30 | @property (nonatomic, copy) NSString *publicIpSourceAddress;/*广东省深圳市*/ 31 | /** 32 | 网络下行速率 33 | */ 34 | @property (nonatomic, copy,getter=downloadNetworkSpeed) NSString *downloadNetworkSpeed; 35 | /** 36 | 网络上行速率 37 | */ 38 | @property (nonatomic, copy,getter=uploadNetworkSpeed) NSString *uploadNetworkSpeed; 39 | /** 40 | WIFI总流量 41 | */ 42 | @property (nonatomic, copy,getter=getWIFIFlow) NSString *wifiFlow; 43 | /** 44 | WIFI上行流量 45 | */ 46 | @property (nonatomic, copy,getter=getWIFIOutFlow) NSString *wifiOutFlow; 47 | 48 | /** 49 | WIFI下行流量 50 | */ 51 | @property (nonatomic, copy,getter=getWIFIInFlow) NSString *wifiInFlow; 52 | 53 | /** 54 | 数据总流量 55 | */ 56 | @property (nonatomic, copy,getter=getDataFlow) NSString *dataFlow; 57 | 58 | /** 59 | 数据上行流量 60 | */ 61 | @property (nonatomic, copy,getter=getDataOutFlow) NSString *dataOutFlow; 62 | 63 | /** 64 | 数据下行流量 65 | */ 66 | @property (nonatomic, copy,getter=getDataInFlow) NSString *dataInFlow; 67 | 68 | @property (nonatomic, copy) NSString *carrierName; 69 | 70 | @property (nonatomic, copy) NSString *lastDeviceBootTime; 71 | 72 | + (instancetype)network; 73 | 74 | 75 | /** 76 | 开始网络监听 77 | 78 | @param interval 监听间隔 79 | */ 80 | - (void)start:(NSTimeInterval)interval; 81 | 82 | /** 83 | 停止网络监听 84 | */ 85 | - (void)stop; 86 | 87 | - (void)getNetworkBasicInfo; 88 | 89 | @end 90 | 91 | NS_ASSUME_NONNULL_END 92 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/HLSystemMonitor/HLSystemMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLSystemMonitor.h 3 | // HLSystemMonitor 4 | // 5 | // Created by HanLiu on 2019/11/25. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HLCPUMonitor.h" 11 | #import "HLMemoryMonitor.h" 12 | #import "HLNetworkMonitor.h" 13 | #import "HLDeviceInformation.h" 14 | #import "HLBatteryMonitor.h" 15 | 16 | @interface HLSystemMonitor : NSObject 17 | @property (nonatomic, assign) NSTimeInterval cpuRefreshInterval; 18 | 19 | @property (nonatomic, assign) NSTimeInterval memoryRefreshInterval; 20 | 21 | @property (nonatomic, assign) NSTimeInterval netowrkRefreshInterval; 22 | 23 | + (instancetype)sharedMonitor; 24 | 25 | - (void)parseDeviceFile; 26 | #pragma mark - 网络信息 27 | /// 开始监测网络流量 28 | + (void)startMonitorNetworkFlowWith:(NSTimeInterval)interval; 29 | 30 | #pragma mark - 内存信息 31 | + (void)startMemoryMonitor:(NSTimeInterval)interval; 32 | 33 | + (void)stopMonitor; 34 | @end 35 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/HLSystemMonitor/HLSystemMonitor.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLSystemMonitor.m 3 | // HLSystemMonitor 4 | // 5 | // Created by HanLiu on 2019/11/25. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLSystemMonitor.h" 10 | 11 | @implementation HLSystemMonitor 12 | 13 | + (instancetype)sharedMonitor { 14 | static HLSystemMonitor *monitor = nil; 15 | static dispatch_once_t onceToken; 16 | dispatch_once(&onceToken, ^{ 17 | monitor = [[HLSystemMonitor alloc] init]; 18 | }); 19 | return monitor; 20 | } 21 | 22 | - (instancetype)init { 23 | if (self = [super init]) { 24 | self.cpuRefreshInterval = 3; 25 | self.memoryRefreshInterval = 3; 26 | self.netowrkRefreshInterval = 1; 27 | //注册通知 28 | } 29 | return self; 30 | } 31 | 32 | - (void)parseDeviceFile { 33 | NSString *deviceName = [HLDeviceInformation getDeviceName]; 34 | // deviceName = @"iPhone X"; 35 | 36 | // NSString *path = [[NSBundle mainBundle] pathForResource:@"devices" ofType:@"json"]; 37 | NSString *path = [[NSBundle mainBundle] pathForResource:@"devices" ofType:@"json" inDirectory:@"/Frameworks/iSystantMonitorFramework.framework"]; 38 | if ([[NSFileManager defaultManager] fileExistsAtPath:path]) { 39 | NSData *data = [NSData dataWithContentsOfFile:path]; 40 | //放到framework里面,变成数组了???原来是字典呀 41 | NSDictionary *devices = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil]; 42 | if ([devices objectForKey:deviceName]) { 43 | [HLDeviceInformation sharedInstance].deviceDict = [devices objectForKey:deviceName]; 44 | NSLog(@"%@",[devices objectForKey:deviceName]); 45 | } 46 | else if([deviceName containsString:@"iPad"]){//如果是模拟器,并且是iPad 47 | if ([deviceName containsString:@"iPad Pro"]) { 48 | [HLDeviceInformation sharedInstance].deviceDict = [devices objectForKey:@"iPad Pro 3rd 12.9"]; 49 | }else if ([deviceName containsString:@"iPad Mini"]) { 50 | [HLDeviceInformation sharedInstance].deviceDict = [devices objectForKey:@"iPad Mini 2019"]; 51 | }else if ([deviceName containsString:@"iPad Air"]) { 52 | [HLDeviceInformation sharedInstance].deviceDict = [devices objectForKey:@"iPad Air 2019"]; 53 | } 54 | } 55 | } 56 | 57 | } 58 | #pragma mark - 网络信息 59 | /// 开始监测网络流量 60 | + (void)startMonitorNetworkFlowWith:(NSTimeInterval)interval { 61 | [[HLNetworkMonitor network] start:interval]; 62 | } 63 | #pragma mark - 内存信息 64 | + (void)startMemoryMonitor:(NSTimeInterval)interval { 65 | [[HLMemoryMonitor monitor] start:interval]; 66 | } 67 | 68 | + (void)stopMonitor { 69 | [[HLNetworkMonitor network] stop]; 70 | [[HLMemoryMonitor monitor] stop]; 71 | } 72 | @end 73 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /iSystantMonitorFramework/iSystantMonitorFramework.h: -------------------------------------------------------------------------------- 1 | // 2 | // iSystantMonitorFramework.h 3 | // iSystantMonitorFramework 4 | // 5 | // Created by HanLiu on 2019/12/4. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HLSystemMonitor.h" 11 | //! Project version number for iSystantMonitorFramework. 12 | FOUNDATION_EXPORT double iSystantMonitorFrameworkVersionNumber; 13 | 14 | //! Project version string for iSystantMonitorFramework. 15 | FOUNDATION_EXPORT const unsigned char iSystantMonitorFrameworkVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /iSystantMonitorFrameworkTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iSystantMonitorFrameworkTests/iSystantMonitorFrameworkTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // iSystantMonitorFrameworkTests.m 3 | // iSystantMonitorFrameworkTests 4 | // 5 | // Created by HanLiu on 2019/12/4. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface iSystantMonitorFrameworkTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation iSystantMonitorFrameworkTests 16 | 17 | - (void)setUp { 18 | // Put setup code here. This method is called before the invocation of each test method in the class. 19 | } 20 | 21 | - (void)tearDown { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | - (void)testExample { 26 | // This is an example of a functional test case. 27 | // Use XCTAssert and related functions to verify your tests produce the correct results. 28 | } 29 | 30 | - (void)testPerformanceExample { 31 | // This is an example of a performance test case. 32 | [self measureBlock:^{ 33 | // Put the code you want to measure the time of here. 34 | }]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /kajslkd.xcodeproj/xcshareddata/xcschemes/kajslkd.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /kajslkd.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /kajslkd/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // kajslkd 4 | // 5 | // Created by HanLiu on 2019/11/24. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /kajslkd/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // kajslkd 4 | // 5 | // Created by HanLiu on 2019/11/24. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | //1.启动统计SDK 20 | [MSAppCenter start:@"b7437d8d-b9c3-4453-82b7-7781c73215d1" withServices:@[[MSAnalytics class],[MSCrashes class]]]; 21 | 22 | //2.设置主题 23 | [self configThemeModeTraitCollection]; 24 | //4.初始化电池健康度 25 | NSString *batteryHeathy = [UserDefaultSuite objectForKey:@"batteryHeath"]; 26 | if (batteryHeathy == 0) { 27 | [UserDefaultSuite setObject:@"100%" forKey:@"batteryHeath"]; 28 | } 29 | //5.读取设置json信息文件。 30 | [[HLSystemMonitor sharedMonitor] parseDeviceFile]; 31 | 32 | 33 | NSArray *languages = [[NSUserDefaults standardUserDefaults] valueForKey:@"AppleLanguages"]; 34 | NSLog(@"AppleLanguages 语言有 %@", languages); 35 | NSString *currentLanguage = languages.firstObject; 36 | NSLog(@"模拟器当前语言:%@",currentLanguage); 37 | 38 | return YES; 39 | } 40 | 41 | - (void)configThemeModeTraitCollection { 42 | [[DKColorTable sharedColorTable] setFile:@"theme.txt"]; 43 | BOOL isNight = [[NSUserDefaults standardUserDefaults] boolForKey:@"AppInNight"]; 44 | 45 | DKNightVersionManager * manager = [DKNightVersionManager sharedManager]; 46 | 47 | if (@available(iOS 13.0, *)) { 48 | UIUserInterfaceStyle mode = UITraitCollection.currentTraitCollection.userInterfaceStyle; 49 | if (mode == UIUserInterfaceStyleDark) { 50 | NSLog(@"深色模式"); 51 | [manager nightFalling]; 52 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"AppInNight"]; 53 | 54 | } else if (mode == UIUserInterfaceStyleLight) { 55 | NSLog(@"浅色模式"); 56 | [manager dawnComing]; 57 | [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"AppInNight"]; 58 | 59 | } else { 60 | NSLog(@"未知模式"); 61 | } 62 | }else { 63 | manager.themeVersion = isNight ? DKThemeVersionNight:DKThemeVersionNormal; 64 | } 65 | } 66 | #pragma mark - UISceneSession lifecycle 67 | 68 | 69 | - (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { 70 | // Called when a new scene session is being created. 71 | // Use this method to select a configuration to create the new scene with. 72 | return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; 73 | } 74 | 75 | 76 | - (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { 77 | // Called when the user discards a scene session. 78 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 79 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 80 | } 81 | 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-Notification@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-Notification@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-Small@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-Small@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-Small-40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-Small-40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "1024x1024", 53 | "idiom" : "ios-marketing", 54 | "filename" : "icon.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-Notification.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-Notification@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-Small.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-Small@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-Small-40.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-Small-40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-76.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "16x16", 113 | "idiom" : "mac", 114 | "filename" : "icon_16x16.png", 115 | "scale" : "1x" 116 | }, 117 | { 118 | "size" : "16x16", 119 | "idiom" : "mac", 120 | "filename" : "icon_16x16@2x.png", 121 | "scale" : "2x" 122 | }, 123 | { 124 | "size" : "32x32", 125 | "idiom" : "mac", 126 | "filename" : "icon_32x32.png", 127 | "scale" : "1x" 128 | }, 129 | { 130 | "size" : "32x32", 131 | "idiom" : "mac", 132 | "filename" : "icon_32x32@2x.png", 133 | "scale" : "2x" 134 | }, 135 | { 136 | "size" : "128x128", 137 | "idiom" : "mac", 138 | "filename" : "icon_128x128.png", 139 | "scale" : "1x" 140 | }, 141 | { 142 | "size" : "128x128", 143 | "idiom" : "mac", 144 | "filename" : "icon_128x128@2x.png", 145 | "scale" : "2x" 146 | }, 147 | { 148 | "size" : "256x256", 149 | "idiom" : "mac", 150 | "filename" : "icon_256x256.png", 151 | "scale" : "1x" 152 | }, 153 | { 154 | "size" : "256x256", 155 | "idiom" : "mac", 156 | "filename" : "icon_256x256@2x.png", 157 | "scale" : "2x" 158 | }, 159 | { 160 | "size" : "512x512", 161 | "idiom" : "mac", 162 | "filename" : "icon_512x512.png", 163 | "scale" : "1x" 164 | }, 165 | { 166 | "size" : "512x512", 167 | "idiom" : "mac", 168 | "filename" : "icon_512x512@2x.png", 169 | "scale" : "2x" 170 | } 171 | ] 172 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Notification.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Notification@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Notification@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Notification@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Notification@3x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small-40.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon_128x128.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon_16x16.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon_256x256.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon_32x32.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon_512x512.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_battery_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_battery_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_battery_normal.imageset/icon_battery_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Day/icon_battery_normal.imageset/icon_battery_normal@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_cpu_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_cpu_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_cpu_normal.imageset/icon_cpu_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Day/icon_cpu_normal.imageset/icon_cpu_normal@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_memory_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_memory_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_memory_normal.imageset/icon_memory_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Day/icon_memory_normal.imageset/icon_memory_normal@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_network_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_network_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_network_normal.imageset/icon_network_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Day/icon_network_normal.imageset/icon_network_normal@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_setting_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "setting_select@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_setting_normal.imageset/setting_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Day/icon_setting_normal.imageset/setting_select@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_storage_normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_storage_normal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Day/icon_storage_normal.imageset/icon_storage_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Day/icon_storage_normal.imageset/icon_storage_normal@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Icon-60.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Icon-60@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "Icon-60@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Icon-60.imageset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Icon-60.imageset/Icon-60@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Icon-60.imageset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Icon-60.imageset/Icon-60@3x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/battery_night.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "battery@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/battery_night.imageset/battery@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Night/battery_night.imageset/battery@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/cpu_night.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "cpu@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/cpu_night.imageset/cpu@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Night/cpu_night.imageset/cpu@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/icon_setting_night.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "setting_unselect@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/icon_setting_night.imageset/setting_unselect@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Night/icon_setting_night.imageset/setting_unselect@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/memory_night.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "memory@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/memory_night.imageset/memory@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Night/memory_night.imageset/memory@2x.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/menu_night.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "menu.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/menu_night.imageset/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Night/menu_night.imageset/menu.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/network_night.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "network.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/network_night.imageset/network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Night/network_night.imageset/network.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/refresh_icon_night.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "refresh_icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/refresh_icon_night.imageset/refresh_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Night/refresh_icon_night.imageset/refresh_icon.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/setting_night.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "setting.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/setting_night.imageset/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Night/setting_night.imageset/setting.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/storage_night.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "storage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/Night/storage_night.imageset/storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/Night/storage_night.imageset/storage.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/download.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "download.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/download.imageset/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/download.imageset/download.png -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/upload.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "upload.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /kajslkd/Assets.xcassets/upload.imageset/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/kajslkd/Assets.xcassets/upload.imageset/upload.png -------------------------------------------------------------------------------- /kajslkd/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLBatteryCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLBatteryCell.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLBatteryCell : HLBaseTableViewCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLBatteryCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLBatteryCell.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBatteryCell.h" 10 | 11 | @interface HLBatteryCell () 12 | 13 | @property (nonatomic, strong) UIImageView *icon; 14 | @property (nonatomic, strong) UILabel *titleLbl; 15 | @property (nonatomic, strong) UILabel *batteryLevelLbl; 16 | @property (nonatomic, strong) UILabel *batteryStateLbl; 17 | @property (nonatomic, strong) UILabel *batteryRescLabel; 18 | @property (nonatomic, strong) UIProgressView *progressView; 19 | @property (nonatomic, strong) dispatch_source_t timer; 20 | 21 | @end 22 | @implementation HLBatteryCell 23 | 24 | - (void)configSubViews { 25 | [super configSubViews]; 26 | NSLog(@"HLMemoryCell configSubViews"); 27 | [self.contentView addSubview:self.icon]; 28 | [self.contentView addSubview:self.titleLbl]; 29 | [self.contentView addSubview:self.batteryLevelLbl]; 30 | [self.contentView addSubview:self.progressView]; 31 | [self.contentView addSubview:self.batteryStateLbl]; 32 | [self.contentView addSubview:self.batteryRescLabel]; 33 | } 34 | 35 | - (void)configLayout { 36 | NSLog(@"HLMemoryCell configLayout"); 37 | [super configLayout]; 38 | 39 | [self.icon mas_makeConstraints:^(MASConstraintMaker *make) { 40 | make.left.mas_equalTo(18); 41 | make.top.mas_equalTo(18); 42 | make.width.height.mas_equalTo(44); 43 | }]; 44 | 45 | [self.titleLbl mas_makeConstraints:^(MASConstraintMaker *make) { 46 | make.top.mas_equalTo(20); 47 | make.left.equalTo(self.icon.mas_right).offset(10); 48 | make.width.mas_greaterThanOrEqualTo(40); 49 | make.height.mas_equalTo(22); 50 | }]; 51 | 52 | [self.batteryLevelLbl mas_makeConstraints:^(MASConstraintMaker *make) { 53 | make.top.equalTo(self.titleLbl.mas_bottom).offset(16); 54 | make.left.equalTo(self.titleLbl.mas_left); 55 | make.right.mas_equalTo(-24); 56 | make.height.mas_equalTo(22); 57 | }]; 58 | [self.batteryStateLbl mas_makeConstraints:^(MASConstraintMaker *make) { 59 | make.top.mas_equalTo(20); 60 | make.right.mas_equalTo(-24); 61 | make.width.mas_greaterThanOrEqualTo(40); 62 | make.height.mas_equalTo(22); 63 | }]; 64 | [self.batteryRescLabel mas_makeConstraints:^(MASConstraintMaker *make) { 65 | make.right.mas_equalTo(-24); 66 | make.top.equalTo(self.titleLbl.mas_bottom).offset(16); 67 | make.height.mas_equalTo(22); 68 | }]; 69 | [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) { 70 | make.bottom.mas_equalTo(-24); 71 | make.left.equalTo(self.batteryLevelLbl.mas_left); 72 | make.height.mas_equalTo(8); 73 | make.right.mas_equalTo(-24); 74 | }]; 75 | } 76 | 77 | - (void)configData { 78 | self.titleLbl.text = HLLocalized(@"Battery"); 79 | 80 | if (_timer == nil) { 81 | __weak typeof(self)wself = self; 82 | self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue()); 83 | dispatch_source_set_timer(self.timer, DISPATCH_TIME_NOW, 30 * NSEC_PER_SEC, 0 * NSEC_PER_SEC); 84 | dispatch_source_set_event_handler(self.timer, ^{ 85 | __strong typeof(wself)strongSelf = wself; 86 | [strongSelf configBatteryData]; 87 | }); 88 | dispatch_resume(self.timer); 89 | } 90 | } 91 | 92 | - (void)configBatteryData { 93 | //进度条表示当前电量百分比 94 | float level = [UIDevice currentDevice].batteryLevel; 95 | self.progressView.progress = level;; 96 | 97 | NSString *batteryLevel = [HLBatteryMonitor getBatteryLevel]; 98 | NSString *batteryState = [HLBatteryMonitor getBatteryState]; 99 | //出场电量 100 | NSString *oriBattery = [[HLDeviceInformation sharedInstance].deviceDict[@"Battery"] componentsSeparatedByString:@"mAh"][0]; 101 | //手动设置的电池健康度 102 | NSString *batteryHeathy = [[UserDefaultSuite objectForKey:@"batteryHeath"] componentsSeparatedByString:@"%"][0]; 103 | //电池真实电量=出场电量*电池健康度*当前电池level 104 | float actualBattery = oriBattery.floatValue * (batteryHeathy.floatValue/100) * level; 105 | 106 | NSLog(@"\nBattery:%@ ,%@ , %@",oriBattery,batteryLevel,batteryState); 107 | self.batteryLevelLbl.text = [NSString stringWithFormat:@"%@mAh %@",oriBattery,batteryLevel]; 108 | self.batteryStateLbl.text = batteryState; 109 | self.batteryRescLabel.text = [NSString stringWithFormat:@"%@:%.0fmAh",HLLocalized(@"Real Remain"),actualBattery]; 110 | 111 | } 112 | 113 | #pragma mark - Getter 114 | - (UIImageView *)icon { 115 | if (_icon == nil) { 116 | _icon = [[UIImageView alloc] init]; 117 | _icon.dk_imagePicker = DKImagePickerWithImages([UIImage imageNamed:@"icon_battery_normal"], [UIImage imageNamed:@"battery_night"]); 118 | } 119 | return _icon; 120 | } 121 | 122 | - (UILabel *)titleLbl { 123 | if (_titleLbl == nil) { 124 | _titleLbl = [UILabel new]; 125 | _titleLbl.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; 126 | _titleLbl.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0xFFFFFF); 127 | } 128 | return _titleLbl; 129 | } 130 | 131 | - (UILabel *)batteryLevelLbl { 132 | if (_batteryLevelLbl == nil) { 133 | _batteryLevelLbl = [UILabel new]; 134 | _batteryLevelLbl.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 135 | _batteryLevelLbl.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 136 | } 137 | return _batteryLevelLbl; 138 | } 139 | 140 | - (UILabel *)batteryStateLbl { 141 | if (_batteryStateLbl == nil) { 142 | _batteryStateLbl = [UILabel new]; 143 | _batteryStateLbl.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 144 | _batteryStateLbl.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 145 | } 146 | return _batteryStateLbl; 147 | } 148 | 149 | - (UILabel *)batteryRescLabel { 150 | if (_batteryRescLabel == nil) { 151 | _batteryRescLabel = [UILabel new]; 152 | _batteryRescLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 153 | _batteryRescLabel.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 154 | } 155 | return _batteryRescLabel; 156 | } 157 | - (UIProgressView *)progressView { 158 | if (_progressView == nil) { 159 | _progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar]; 160 | _progressView.dk_trackTintColorPicker = DKColorPickerWithRGB(0xF0F0F1,0x34343D); 161 | _progressView.progressTintColor = [UIColor colorWithHex:@"0x2ED573"]; 162 | _progressView.layer.cornerRadius = 4; 163 | _progressView.layer.masksToBounds = YES; 164 | } 165 | return _progressView; 166 | } 167 | 168 | @end 169 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLCPUCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLCPUCell.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLCPUCell : HLBaseTableViewCell 14 | 15 | - (void)configCPUData; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLDetailTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLDetailTableViewCell.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/13. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLDetailTableViewCell : HLBaseTableViewCell 14 | 15 | - (void)configData:(NSDictionary *)dic; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLDetailTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLDetailTableViewCell.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/13. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLDetailTableViewCell.h" 10 | @interface HLDetailTableViewCell () 11 | 12 | @property (nonatomic, strong) UILabel *titleLbl; 13 | @property (nonatomic, strong) UILabel *detailLbl; 14 | 15 | @end 16 | @implementation HLDetailTableViewCell 17 | 18 | - (void)configSubViews { 19 | [super configSubViews]; 20 | [self.contentView addSubview:self.titleLbl]; 21 | [self.contentView addSubview:self.detailLbl]; 22 | } 23 | 24 | - (void)configLayout { 25 | [super configLayout]; 26 | 27 | [self.titleLbl mas_makeConstraints:^(MASConstraintMaker *make) { 28 | make.left.mas_equalTo(20); 29 | make.centerY.mas_equalTo(0); 30 | make.width.mas_greaterThanOrEqualTo(40); 31 | make.height.mas_equalTo(22); 32 | }]; 33 | [self.detailLbl mas_makeConstraints:^(MASConstraintMaker *make) { 34 | make.centerY.mas_equalTo(0); 35 | // make.right.mas_equalTo(-12); 36 | make.right.mas_equalTo(-24); 37 | make.height.mas_equalTo(22); 38 | }]; 39 | } 40 | 41 | - (void)configData:(NSDictionary *)dic { 42 | self.titleLbl.text = dic[@"name"]; 43 | self.detailLbl.text = dic[@"value"]; 44 | } 45 | 46 | #pragma mark - Getter 47 | 48 | - (UILabel *)titleLbl { 49 | if (_titleLbl == nil) { 50 | _titleLbl = [UILabel new]; 51 | _titleLbl.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; 52 | _titleLbl.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0xFFFFFF); 53 | } 54 | return _titleLbl; 55 | } 56 | 57 | - (UILabel *)detailLbl { 58 | if (_detailLbl == nil) { 59 | _detailLbl = [UILabel new]; 60 | _detailLbl.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 61 | _detailLbl.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 62 | } 63 | return _detailLbl; 64 | } 65 | @end 66 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLDeviceCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLDeviceCell.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/7. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLDeviceCell : HLBaseTableViewCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLDeviceCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLDeviceCell.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/7. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLDeviceCell.h" 10 | 11 | @interface HLDeviceCell() 12 | 13 | @property (nonatomic, strong) UIImageView *icon; 14 | @property (nonatomic, strong) UILabel *titleLbl; 15 | @property (nonatomic, strong) UILabel *diskInfo; 16 | @property (nonatomic, strong) UILabel *buildLabel; 17 | @property (nonatomic, strong) UILabel *pubIPLabel; 18 | 19 | @end 20 | 21 | @implementation HLDeviceCell 22 | 23 | - (void)configSubViews { 24 | [super configSubViews]; 25 | [self.contentView addSubview:self.icon]; 26 | [self.contentView addSubview:self.titleLbl]; 27 | [self.contentView addSubview:self.diskInfo]; 28 | [self.contentView addSubview:self.buildLabel]; 29 | [self.contentView addSubview:self.pubIPLabel]; 30 | 31 | } 32 | 33 | - (void)configLayout { 34 | [super configLayout]; 35 | [self.icon mas_makeConstraints:^(MASConstraintMaker *make) { 36 | make.left.mas_equalTo(18); 37 | make.top.mas_equalTo(18); 38 | make.width.height.mas_equalTo(44); 39 | }]; 40 | 41 | [self.titleLbl mas_makeConstraints:^(MASConstraintMaker *make) { 42 | make.top.mas_equalTo(20); 43 | make.left.equalTo(self.icon.mas_right).offset(10); 44 | make.width.mas_greaterThanOrEqualTo(40); 45 | make.height.mas_equalTo(22); 46 | }]; 47 | [self.diskInfo mas_makeConstraints:^(MASConstraintMaker *make) { 48 | make.top.equalTo(self.titleLbl.mas_bottom).offset(16); 49 | make.left.equalTo(self.titleLbl.mas_left); 50 | make.width.mas_greaterThanOrEqualTo(24); 51 | make.height.mas_equalTo(22); 52 | }]; 53 | [self.buildLabel mas_makeConstraints:^(MASConstraintMaker *make) { 54 | make.top.equalTo(self.titleLbl.mas_bottom).offset(16); 55 | make.right.mas_equalTo(-24); 56 | make.height.mas_equalTo(22); 57 | }]; 58 | [self.pubIPLabel mas_makeConstraints:^(MASConstraintMaker *make) { 59 | make.top.equalTo(self.titleLbl.mas_bottom).offset(16); 60 | make.left.equalTo(self.diskInfo.mas_right).offset(10); 61 | make.right.mas_equalTo(-24); 62 | make.height.mas_equalTo(22); 63 | }]; 64 | } 65 | 66 | - (void)configData { 67 | [self configDeviceData]; 68 | } 69 | 70 | - (void)configDeviceData { 71 | 72 | NSString *iphoneName = [NSString stringWithFormat:@"%@ %@",HLLocalized(@"Welcome"), [HLDeviceInformation getiPhoneName]]; 73 | NSString *deviceModel = [HLDeviceInformation getDeviceName]; 74 | NSString *sysVerion = [HLDeviceInformation getSystemVersion]; 75 | NSString *sysBuild = [HLDeviceInformation getSystemBuildVersion]; 76 | NSString *origBatteryVol= [HLDeviceInformation sharedInstance].deviceDict[@"Battery"]; 77 | 78 | NSLog(@"\n设备信息:\n%@\n%@\n%@\n%@\n%@\n",iphoneName,deviceModel,sysVerion,sysBuild,origBatteryVol); 79 | self.titleLbl.text = iphoneName; 80 | self.diskInfo.text = [NSString stringWithFormat:@"%@:%@",HLLocalized(@"OS Version"),sysVerion]; 81 | self.buildLabel.text = [NSString stringWithFormat:@"%@:%@",HLLocalized(@"Build") ,sysBuild]; 82 | // self.pubIPLabel.text = [NSString stringWithFormat:@"%@:%@",HLLocalized(@"Public Ip") ,[HLNetworkMonitor network].publicIp]; 83 | } 84 | 85 | #pragma mark - Getter 86 | - (UIImageView *)icon { 87 | if (_icon == nil) { 88 | _icon = [[UIImageView alloc] init]; 89 | _icon.image = [UIImage imageNamed:@"storage_night"]; 90 | _icon.dk_imagePicker = DKImagePickerWithImages([UIImage imageNamed:@"icon_storage_normal"], [UIImage imageNamed:@"storage_night"]); 91 | } 92 | return _icon; 93 | } 94 | 95 | - (UILabel *)titleLbl { 96 | if (_titleLbl == nil) { 97 | _titleLbl = [UILabel new]; 98 | _titleLbl.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; 99 | _titleLbl.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0xFFFFFF); 100 | } 101 | return _titleLbl; 102 | } 103 | 104 | - (UILabel *)diskInfo { 105 | if (_diskInfo == nil) { 106 | _diskInfo = [UILabel new]; 107 | _diskInfo.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 108 | _diskInfo.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 109 | } 110 | return _diskInfo; 111 | } 112 | 113 | - (UILabel *)buildLabel { 114 | if (_buildLabel == nil) { 115 | _buildLabel = [UILabel new]; 116 | _buildLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 117 | _buildLabel.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 118 | } 119 | return _buildLabel; 120 | } 121 | 122 | - (UILabel *)pubIPLabel { 123 | if (_pubIPLabel == nil) { 124 | _pubIPLabel = [UILabel new]; 125 | _pubIPLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 126 | _pubIPLabel.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 127 | } 128 | return _pubIPLabel; 129 | } 130 | 131 | @end 132 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLMemoryCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLMemoryCell.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLMemoryCell : HLBaseTableViewCell 14 | 15 | - (void)configMemoryData; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLMemoryCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLMemoryCell.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLMemoryCell.h" 10 | #import "HLProgressView.h" 11 | 12 | @interface HLMemoryCell () 13 | 14 | @property (nonatomic, strong) UIImageView *icon; 15 | @property (nonatomic, strong) UILabel *titleLbl; 16 | @property (nonatomic, strong) UILabel *ramInfo; 17 | @property (nonatomic, strong) HLProgressView *progressView; 18 | @property (nonatomic, strong) dispatch_source_t timer; 19 | 20 | @end 21 | @implementation HLMemoryCell 22 | 23 | - (void)configSubViews { 24 | [super configSubViews]; 25 | NSLog(@"HLMemoryCell configSubViews"); 26 | [self.contentView addSubview:self.icon]; 27 | [self.contentView addSubview:self.titleLbl]; 28 | [self.contentView addSubview:self.ramInfo]; 29 | [self.contentView addSubview:self.progressView]; 30 | 31 | } 32 | 33 | - (void)configLayout { 34 | NSLog(@"HLMemoryCell configLayout"); 35 | [super configLayout]; 36 | [self.icon mas_makeConstraints:^(MASConstraintMaker *make) { 37 | make.left.mas_equalTo(18); 38 | make.top.mas_equalTo(18); 39 | make.width.height.mas_equalTo(44); 40 | }]; 41 | 42 | [self.titleLbl mas_makeConstraints:^(MASConstraintMaker *make) { 43 | make.top.mas_equalTo(20); 44 | make.left.equalTo(self.icon.mas_right).offset(10); 45 | make.width.mas_greaterThanOrEqualTo(40); 46 | make.height.mas_equalTo(22); 47 | }]; 48 | 49 | [self.ramInfo mas_makeConstraints:^(MASConstraintMaker *make) { 50 | make.top.equalTo(self.titleLbl.mas_bottom).offset(16); 51 | make.left.equalTo(self.titleLbl.mas_left); 52 | make.right.mas_equalTo(-24); 53 | make.height.mas_equalTo(22); 54 | }]; 55 | [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) { 56 | make.bottom.mas_equalTo(-24); 57 | make.left.equalTo(self.ramInfo.mas_left); 58 | make.height.mas_equalTo(8); 59 | make.right.mas_equalTo(-24); 60 | }]; 61 | } 62 | 63 | - (void)configData { 64 | if (_timer == nil) { 65 | __weak typeof(self)wself = self; 66 | self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue()); 67 | dispatch_source_set_timer(self.timer, DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC, 0 * NSEC_PER_SEC); 68 | dispatch_source_set_event_handler(self.timer, ^{ 69 | __strong typeof(wself)strongSelf = wself; 70 | [strongSelf configMemoryData]; 71 | }); 72 | dispatch_resume(self.timer); 73 | } 74 | } 75 | 76 | - (void)configMemoryData { 77 | self.titleLbl.text = HLLocalized(@"Memory"); 78 | NSString *usedRAM = [HLMemoryMonitor monitor].totalUsedMemory; 79 | NSString *freeRAM = [HLMemoryMonitor monitor].totalAvaliableMemory; 80 | NSString *totalRAM = [[HLDeviceInformation sharedInstance].deviceDict objectForKey:@"RAM"]; 81 | NSString *totalRAM2 = [HLMemoryMonitor monitor].totalMemory; 82 | 83 | // NSLog(@"\n RAM: %@ -- %@ --- %@",usedRAM,totalRAM,totalRAM2 ); 84 | self.ramInfo.text = [NSString stringWithFormat:@"Free:%@ Used:%@ Total:%@",freeRAM,usedRAM,totalRAM2]; 85 | self.progressView.progress = [HLMemoryMonitor monitor].memoryUsagePercentage; 86 | } 87 | 88 | #pragma mark - Getter 89 | - (UIImageView *)icon { 90 | if (_icon == nil) { 91 | _icon = [[UIImageView alloc] init]; 92 | _icon.dk_imagePicker = DKImagePickerWithImages([UIImage imageNamed:@"icon_memory_normal"], [UIImage imageNamed:@"memory_night"]); 93 | } 94 | return _icon; 95 | } 96 | 97 | - (UILabel *)titleLbl { 98 | if (_titleLbl == nil) { 99 | _titleLbl = [UILabel new]; 100 | _titleLbl.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; 101 | _titleLbl.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0xFFFFFF); 102 | } 103 | return _titleLbl; 104 | } 105 | 106 | - (UILabel *)ramInfo { 107 | if (_ramInfo == nil) { 108 | _ramInfo = [UILabel new]; 109 | _ramInfo.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 110 | _ramInfo.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 111 | } 112 | return _ramInfo; 113 | } 114 | 115 | - (HLProgressView *)progressView { 116 | if (_progressView == nil) { 117 | _progressView = [[HLProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar]; 118 | _progressView.dk_trackTintColorPicker = DKColorPickerWithRGB(0xF0F0F1,0x34343D); 119 | _progressView.progressTintColor = [UIColor colorWithHex:@"0x2ED573"]; 120 | _progressView.layer.cornerRadius = 4; 121 | _progressView.layer.masksToBounds = YES; 122 | } 123 | return _progressView; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLNetworkCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLNetworkCell.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLNetworkCell : HLBaseTableViewCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLNetworkCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLNetworkCell.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLNetworkCell.h" 10 | #import "HLNetworkMonitor.h" 11 | 12 | @interface HLNetworkCell () 13 | 14 | @property (nonatomic, strong) UIImageView *icon; 15 | @property (nonatomic, strong) UILabel *titleLbl; 16 | @property (nonatomic, strong) UIImageView *uploadSpeedImg; 17 | @property (nonatomic, strong) UIImageView *downloadSpeedImg; 18 | @property (nonatomic, strong) UILabel *uploadSpeedLabel; 19 | @property (nonatomic, strong) UILabel *downloadSpeedLabel; 20 | @property (nonatomic, strong) dispatch_source_t timer; 21 | @end 22 | @implementation HLNetworkCell 23 | 24 | - (void)configSubViews { 25 | [super configSubViews]; 26 | NSLog(@"HLNetworkCell configSubViews"); 27 | 28 | [self.contentView addSubview:self.icon]; 29 | [self.contentView addSubview:self.titleLbl]; 30 | [self.contentView addSubview:self.uploadSpeedLabel]; 31 | [self.contentView addSubview:self.downloadSpeedLabel]; 32 | [self.contentView addSubview:self.uploadSpeedImg]; 33 | [self.contentView addSubview:self.downloadSpeedImg]; 34 | 35 | } 36 | 37 | - (void)configLayout { 38 | [super configLayout]; 39 | NSLog(@"HLNetworkCell configLayout"); 40 | 41 | [self.icon mas_makeConstraints:^(MASConstraintMaker *make) { 42 | make.left.mas_equalTo(18); 43 | make.top.mas_equalTo(18); 44 | make.width.height.mas_equalTo(44); 45 | }]; 46 | 47 | [self.titleLbl mas_makeConstraints:^(MASConstraintMaker *make) { 48 | make.top.mas_equalTo(20); 49 | make.left.equalTo(self.icon.mas_right).offset(10); 50 | make.width.mas_greaterThanOrEqualTo(40); 51 | make.height.mas_equalTo(22); 52 | }]; 53 | 54 | [self.uploadSpeedImg mas_makeConstraints:^(MASConstraintMaker *make) { 55 | make.left.equalTo(self.titleLbl.mas_left); 56 | make.top.equalTo(self.titleLbl.mas_bottom).offset(10); 57 | make.height.mas_equalTo(22); 58 | make.width.mas_equalTo(22); 59 | }]; 60 | 61 | [self.uploadSpeedLabel mas_makeConstraints:^(MASConstraintMaker *make) { 62 | make.left.equalTo(self.uploadSpeedImg.mas_right).offset(4); 63 | make.top.equalTo(self.titleLbl.mas_bottom).offset(10); 64 | make.height.mas_equalTo(22); 65 | make.width.mas_greaterThanOrEqualTo(36); 66 | }]; 67 | 68 | [self.downloadSpeedImg mas_makeConstraints:^(MASConstraintMaker *make) { 69 | make.centerX.equalTo(self.contentView).offset(60); 70 | make.top.equalTo(self.titleLbl.mas_bottom).offset(10); 71 | make.height.mas_equalTo(22); 72 | make.width.mas_equalTo(22); 73 | }]; 74 | 75 | [self.downloadSpeedLabel mas_makeConstraints:^(MASConstraintMaker *make) { 76 | make.left.equalTo(self.downloadSpeedImg.mas_right).offset(4); 77 | make.top.equalTo(self.titleLbl.mas_bottom).offset(10); 78 | make.height.mas_equalTo(22); 79 | make.width.mas_greaterThanOrEqualTo(36); 80 | }]; 81 | } 82 | 83 | - (void)configData { 84 | self.titleLbl.text = HLLocalized(@"Network"); 85 | 86 | if (_timer == nil) { 87 | __weak typeof(self)wself = self; 88 | self.timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue()); 89 | dispatch_source_set_timer(self.timer, DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC, 0 * NSEC_PER_SEC); 90 | dispatch_source_set_event_handler(self.timer, ^{ 91 | __strong typeof(wself)strongSelf = wself; 92 | [strongSelf refreshNetworkSpeed]; 93 | }); 94 | dispatch_resume(self.timer); 95 | } 96 | 97 | } 98 | 99 | - (void)refreshNetworkSpeed { 100 | dispatch_async(dispatch_get_main_queue(), ^{ 101 | NSString *downloadSpeed = [HLNetworkMonitor network].downloadNetworkSpeed; 102 | NSString *uploadSpeed = [HLNetworkMonitor network].uploadNetworkSpeed; 103 | self.uploadSpeedLabel.text = uploadSpeed; 104 | self.downloadSpeedLabel.text = downloadSpeed; 105 | 106 | }); 107 | } 108 | 109 | #pragma mark - Getter 110 | - (UIImageView *)icon { 111 | if (_icon == nil) { 112 | _icon = [[UIImageView alloc] init]; 113 | _icon.dk_imagePicker = DKImagePickerWithImages([UIImage imageNamed:@"icon_network_normal"], [UIImage imageNamed:@"network_night"]); 114 | } 115 | return _icon; 116 | } 117 | 118 | - (UILabel *)titleLbl { 119 | if (_titleLbl == nil) { 120 | _titleLbl = [UILabel new]; 121 | _titleLbl.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; 122 | _titleLbl.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0xFFFFFF); 123 | } 124 | return _titleLbl; 125 | } 126 | 127 | - (UILabel *)uploadSpeedLabel { 128 | if (_uploadSpeedLabel == nil) { 129 | _uploadSpeedLabel = [UILabel new]; 130 | _uploadSpeedLabel.text = @"0.0B/s"; 131 | _uploadSpeedLabel.textAlignment = NSTextAlignmentLeft; 132 | _uploadSpeedLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 133 | _uploadSpeedLabel.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 134 | } 135 | return _uploadSpeedLabel; 136 | } 137 | 138 | - (UILabel *)downloadSpeedLabel { 139 | if (_downloadSpeedLabel == nil) { 140 | _downloadSpeedLabel = [UILabel new]; 141 | _downloadSpeedLabel.text = @"0.0B/s"; 142 | _downloadSpeedLabel.textAlignment = NSTextAlignmentLeft; 143 | _downloadSpeedLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 144 | _downloadSpeedLabel.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 145 | } 146 | return _downloadSpeedLabel; 147 | } 148 | 149 | - (UIImageView *)uploadSpeedImg { 150 | if (_uploadSpeedImg == nil) { 151 | _uploadSpeedImg = [UIImageView new]; 152 | _uploadSpeedImg.image = [UIImage imageNamed:@"upload"]; 153 | } 154 | return _uploadSpeedImg; 155 | } 156 | 157 | - (UIImageView *)downloadSpeedImg { 158 | if (_downloadSpeedImg == nil) { 159 | _downloadSpeedImg = [UIImageView new]; 160 | _downloadSpeedImg.image = [UIImage imageNamed:@"download"]; 161 | } 162 | return _downloadSpeedImg; 163 | } 164 | @end 165 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLStorageCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLStorageCell.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseTableViewCell.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLStorageCell : HLBaseTableViewCell 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /kajslkd/Class/Cell/HLStorageCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLStorageCell.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLStorageCell.h" 10 | #import "HLProgressView.h" 11 | 12 | @interface HLStorageCell () 13 | 14 | @property (nonatomic, strong) UIImageView *icon; 15 | @property (nonatomic, strong) UILabel *titleLbl; 16 | @property (nonatomic, strong) UILabel *diskInfo; 17 | @property (nonatomic, strong) HLProgressView *progressView; 18 | 19 | @end 20 | 21 | @implementation HLStorageCell 22 | 23 | - (void)configSubViews { 24 | [super configSubViews]; 25 | NSLog(@"HLStorageCell configSubViews"); 26 | [self.contentView addSubview:self.icon]; 27 | [self.contentView addSubview:self.titleLbl]; 28 | [self.contentView addSubview:self.diskInfo]; 29 | [self.contentView addSubview:self.progressView]; 30 | 31 | } 32 | 33 | - (void)configLayout { 34 | [super configLayout]; 35 | NSLog(@"HLStorageCell configLayout"); 36 | [self.icon mas_makeConstraints:^(MASConstraintMaker *make) { 37 | make.left.mas_equalTo(18); 38 | make.top.mas_equalTo(18); 39 | make.width.height.mas_equalTo(44); 40 | }]; 41 | 42 | [self.titleLbl mas_makeConstraints:^(MASConstraintMaker *make) { 43 | make.top.mas_equalTo(20); 44 | make.left.equalTo(self.icon.mas_right).offset(10); 45 | make.width.mas_greaterThanOrEqualTo(40); 46 | make.height.mas_equalTo(22); 47 | }]; 48 | [self.diskInfo mas_makeConstraints:^(MASConstraintMaker *make) { 49 | make.top.equalTo(self.titleLbl.mas_bottom).offset(16); 50 | make.left.equalTo(self.titleLbl.mas_left); 51 | make.right.mas_equalTo(-24); 52 | make.height.mas_equalTo(22); 53 | }]; 54 | [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) { 55 | make.bottom.mas_equalTo(-30); 56 | make.left.equalTo(self.diskInfo.mas_left); 57 | make.height.mas_equalTo(8); 58 | make.right.mas_equalTo(-24); 59 | }]; 60 | 61 | } 62 | 63 | - (void)configData { 64 | [self configStorageData]; 65 | 66 | // [self.progressView.layer applySketchShadow:[UIColor blackColor] alpha:0.5 x:0 y:3 blur:10 spread:0]; 67 | 68 | } 69 | 70 | - (void)configStorageData { 71 | NSDictionary *dic = [HLDeviceInformation getDeviceSize]; 72 | NSString *totalDisk = dic[@"totalSpace"]; 73 | NSString *usedDisk = dic[@"usedSpace"]; 74 | NSString *freeDisk = dic[@"freeSpace"]; 75 | 76 | NSLog(@"\ntotalDisk:%@\nusedDisk:%@\nfreeDisk:%@",totalDisk,usedDisk,freeDisk); 77 | self.titleLbl.text = HLLocalized(@"Storage"); 78 | self.diskInfo.text = [NSString stringWithFormat:@"Free:%@ Used:%@ Total:%@",freeDisk,usedDisk,totalDisk]; 79 | self.progressView.progress = [dic[@"usedPercentage"] floatValue];; 80 | } 81 | 82 | #pragma mark - Getter 83 | - (UIImageView *)icon { 84 | if (_icon == nil) { 85 | _icon = [[UIImageView alloc] init]; 86 | _icon.image = [UIImage imageNamed:@"storage_night"]; 87 | _icon.dk_imagePicker = DKImagePickerWithImages([UIImage imageNamed:@"icon_storage_normal"], [UIImage imageNamed:@"storage_night"]); 88 | } 89 | return _icon; 90 | } 91 | 92 | - (UILabel *)titleLbl { 93 | if (_titleLbl == nil) { 94 | _titleLbl = [UILabel new]; 95 | _titleLbl.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; 96 | _titleLbl.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0xFFFFFF); 97 | } 98 | return _titleLbl; 99 | } 100 | 101 | - (UILabel *)diskInfo { 102 | if (_diskInfo == nil) { 103 | _diskInfo = [UILabel new]; 104 | _diskInfo.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular]; 105 | _diskInfo.dk_textColorPicker = DKColorPickerWithRGB(0x4A4A4A,0x9B9B9B); 106 | } 107 | return _diskInfo; 108 | } 109 | 110 | - (HLProgressView *)progressView { 111 | if (_progressView == nil) { 112 | _progressView = [[HLProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar]; 113 | _progressView.dk_trackTintColorPicker = DKColorPickerWithRGB(0xF0F0F1,0x34343D); 114 | _progressView.progressTintColor = [UIColor colorWithHex:@"0x2ED573"]; 115 | _progressView.layer.cornerRadius = 4; 116 | _progressView.layer.masksToBounds = YES; 117 | } 118 | return _progressView; 119 | } 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /kajslkd/Class/HLCellViewModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLCellViewModel.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/7. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HLStorageCell.h" 11 | #import "HLMemoryCell.h" 12 | #import "HLCPUCell.h" 13 | #import "HLBatteryCell.h" 14 | #import "HLNetworkCell.h" 15 | #import "HLDeviceCell.h" 16 | 17 | NS_ASSUME_NONNULL_BEGIN 18 | 19 | @interface HLCellViewModel : NSObject 20 | 21 | @property (nonatomic, copy) NSString *title; 22 | @property (nonatomic, assign) CGFloat rowHeight; 23 | @property (nonatomic, copy) NSString *cellIndentifer; 24 | 25 | - (instancetype)initWith:(NSString *)cellIndentifer 26 | rowHeight:(CGFloat)rowHeight 27 | title:(NSString *)title; 28 | 29 | 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /kajslkd/Class/HLCellViewModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLCellViewModel.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/7. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLCellViewModel.h" 10 | 11 | 12 | 13 | @implementation HLCellViewModel 14 | 15 | - (instancetype)initWith:(NSString *)cellIndentifer 16 | rowHeight:(CGFloat)rowHeight 17 | title:(NSString *)title { 18 | if (self == [super init]) { 19 | _title = title; 20 | _rowHeight = rowHeight; 21 | _cellIndentifer = cellIndentifer; 22 | } 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/Detail/HLCPUDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLCPUDetailViewController.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/13. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLCPUDetailViewController : HLBaseViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/Detail/HLCPUDetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLCPUDetailViewController.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/13. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLCPUDetailViewController.h" 10 | 11 | @interface HLCPUDetailViewController () 12 | 13 | @property (nonatomic, strong) UITableView *tableView; 14 | @property (nonatomic, strong) NSArray *datasource; 15 | @end 16 | 17 | @implementation HLCPUDetailViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | self.title = HLLocalized(@"CPU"); 22 | 23 | self.tableView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xF8F8F8,0x111111); 24 | self.view.dk_backgroundColorPicker = DKColorPickerWithRGB(0xF8F8F8,0x111111); 25 | 26 | [self.view addSubview:self.tableView]; 27 | [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { 28 | make.top.mas_equalTo(K_NAVBAR_HEIGHT); 29 | make.left.right.mas_equalTo(0); 30 | make.bottom.mas_equalTo(0); 31 | }]; 32 | [self.tableView registerClass:[HLDetailTableViewCell class] forCellReuseIdentifier:[HLDetailTableViewCell reuseIdentifier]]; 33 | 34 | [self configData]; 35 | } 36 | 37 | - (void)configData { 38 | NSString *cpufreq = [HLCPUMonitor monitor].realtimeCpuFreq; 39 | // NSLog(@"cpufreq = %@",cpufreq); 40 | NSString *cpuModel = [HLDeviceInformation sharedInstance].deviceDict[@"CPU"]; 41 | NSString *cpuArch = [HLDeviceInformation sharedInstance].deviceDict[@"CPU Arch"];; 42 | NSString *cpuCores = [NSString stringWithFormat:@"%@ %@", @([HLCPUMonitor monitor].cpuNumber),NSLocalizedString(@"core", nil)]; 43 | NSString *cpuMaxFreq = [HLDeviceInformation sharedInstance].deviceDict[@"CPU Clock"]; 44 | NSString *L1Cache = [HLDeviceInformation sharedInstance].deviceDict[@"L1 Cache"]; 45 | NSString *L2Cache = [HLDeviceInformation sharedInstance].deviceDict[@"L2 Cache"]; 46 | NSString *L3Cache = [HLDeviceInformation sharedInstance].deviceDict[@"L3 Cache"]; 47 | NSString *soc = [HLDeviceInformation sharedInstance].deviceDict[@"SoC"]; 48 | 49 | NSString *gpuModel = [HLDeviceInformation sharedInstance].deviceDict[@"GPU"]; 50 | NSString *gpuCores = [HLDeviceInformation sharedInstance].deviceDict[@"GPU Cores"]; 51 | 52 | NSString *beenchmark_cpu_single = [HLDeviceInformation sharedInstance].deviceDict[@"Geekbench Single Core"]; 53 | NSString *beenchmark_cpu_multi = [HLDeviceInformation sharedInstance].deviceDict[@"Geekbench Multi Core"]; 54 | NSString *beenchmark_gpu_metal = [HLDeviceInformation sharedInstance].deviceDict[@"Metal"]; 55 | 56 | NSString *motionProc = [HLDeviceInformation sharedInstance].deviceDict[@"Motion Coprocessor"]; 57 | 58 | self.datasource = @[@[@{@"name":HLLocalized(@"Model"),@"value":cpuModel},//内存型号 59 | @{@"name":HLLocalized(@"Arch"),@"value":cpuArch},//读写频率 60 | @{@"name":HLLocalized(@"Cores"),@"value":cpuCores}, 61 | @{@"name":HLLocalized(@"Clock Frequency"),@"value":cpuMaxFreq}, 62 | // @{@"name":HLLocalized(@"Current Frequency"),@"value":cpufreq}, 63 | @{@"name":HLLocalized(@"L1Cache"),@"value":L1Cache}, 64 | @{@"name":HLLocalized(@"L2Cache"),@"value":L2Cache}, 65 | @{@"name":HLLocalized(@"L3Cache"),@"value":L3Cache}, 66 | @{@"name":HLLocalized(@"SoC"),@"value":soc}, 67 | ], 68 | @[ 69 | @{@"name":HLLocalized(@"GPU Model"),@"value":gpuModel}, 70 | @{@"name":HLLocalized(@"GPU Cores"),@"value":gpuCores}, 71 | ], 72 | @[ 73 | @{@"name":HLLocalized(@"CPU Single Core"),@"value":beenchmark_cpu_single}, 74 | @{@"name":HLLocalized(@"CPU Multi Core"),@"value":beenchmark_cpu_multi}, 75 | @{@"name":HLLocalized(@"GPU Metal"),@"value":beenchmark_gpu_metal}, 76 | ], 77 | @[ 78 | @{@"name":HLLocalized(@"Motion Processor"),@"value":motionProc}, 79 | ] 80 | ]; 81 | [self.tableView reloadData]; 82 | } 83 | 84 | - (void)viewWillAppear:(BOOL)animated { 85 | [super viewWillAppear:animated]; 86 | [self.navigationController setNavigationBarHidden:NO animated:NO]; 87 | } 88 | #pragma mark - Delegate 89 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 90 | return self.datasource.count; 91 | } 92 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 93 | return [self.datasource[section] count]; 94 | } 95 | 96 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 97 | HLDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[HLDetailTableViewCell reuseIdentifier]]; 98 | 99 | NSDictionary *dic = self.datasource[indexPath.section][indexPath.row]; 100 | [cell configData:dic]; 101 | return cell; 102 | } 103 | 104 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 105 | NSString *text = @""; 106 | switch (section) { 107 | case 0: 108 | text = HLLocalized(@"CPU Basic Info"); 109 | break; 110 | case 1: 111 | text = HLLocalized(@"GPU"); 112 | break; 113 | case 2: 114 | text = HLLocalized(@"BEENCHMARK"); 115 | break; 116 | default: 117 | break; 118 | } 119 | return text; 120 | } 121 | #pragma mark - Getter 122 | 123 | - (UITableView *)tableView { 124 | if (_tableView == nil) { 125 | _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; 126 | _tableView.delegate = self; 127 | _tableView.dataSource = self; 128 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 129 | 130 | } 131 | return _tableView; 132 | } 133 | @end 134 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/Detail/HLNetworkDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLNetworkDetailViewController.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/13. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLNetworkDetailViewController : HLBaseViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/Detail/HLNetworkDetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLNetworkDetailViewController.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/13. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLNetworkDetailViewController.h" 10 | 11 | @interface HLNetworkDetailViewController () 12 | 13 | @property (nonatomic, strong) UITableView *tableView; 14 | @property (nonatomic, strong) NSMutableArray *datasource; 15 | @property (nonatomic, strong) HLNetworkMonitor *network; 16 | @property (nonatomic, strong) NSTimer *timer; 17 | @property (nonatomic, strong) NSTimer *timerForSpeed; 18 | @end 19 | 20 | @implementation HLNetworkDetailViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | self.title = HLLocalized(@"Network"); 25 | self.datasource = [NSMutableArray arrayWithArray:@[@[],@[],@[]]]; 26 | self.network = [HLNetworkMonitor network]; 27 | 28 | self.tableView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xF8F8F8,0x111111); 29 | self.view.dk_backgroundColorPicker = DKColorPickerWithRGB(0xF8F8F8,0x111111); 30 | 31 | [self.view addSubview:self.tableView]; 32 | [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { 33 | make.top.mas_equalTo(K_NAVBAR_HEIGHT); 34 | make.left.right.mas_equalTo(0); 35 | make.bottom.mas_equalTo(0); 36 | }]; 37 | [self.tableView registerClass:[HLDetailTableViewCell class] forCellReuseIdentifier:[HLDetailTableViewCell reuseIdentifier]]; 38 | 39 | [self refresh]; 40 | 41 | } 42 | 43 | - (void)viewWillAppear:(BOOL)animated { 44 | [super viewWillAppear:animated]; 45 | [self.navigationController setNavigationBarHidden:NO animated:NO]; 46 | [[HLNetworkMonitor network] getNetworkBasicInfo]; 47 | [self config]; 48 | 49 | } 50 | 51 | - (void)viewDidDisappear:(BOOL)animated { 52 | [super viewDidDisappear:animated]; 53 | if (_timer) { 54 | [_timer invalidate]; 55 | _timer = nil; 56 | } 57 | if (_timerForSpeed) { 58 | [_timerForSpeed invalidate]; 59 | _timerForSpeed = nil; 60 | } 61 | } 62 | 63 | - (void)refresh { 64 | //刷新网络流量 65 | // _timer = [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(refreshNetworkFlow) userInfo:nil repeats:YES]; 66 | // [[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes]; 67 | // [_timer fire]; 68 | //刷新网络速率 69 | _timerForSpeed = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(refreshNetworkSpeed) userInfo:nil repeats:YES]; 70 | [[NSRunLoop currentRunLoop] addTimer:_timerForSpeed forMode:NSDefaultRunLoopMode]; 71 | [_timerForSpeed fire]; 72 | } 73 | 74 | - (void)config { 75 | //section0 76 | NSString *carrierName = _network.carrierName; 77 | NSString *networkType = _network.networkType; 78 | NSString *pubIP = _network.publicIp; 79 | NSString *internalIP = _network.internalIp; 80 | NSString *wifiName = _network.wifiName; 81 | NSString *dns = _network.dns; 82 | NSString *wifiMacAddress = _network.wifiMacAddress; 83 | 84 | [self.datasource replaceObjectsInRange:NSMakeRange(0, 1) withObjectsFromArray:@[@[@{@"name":HLLocalized(@"Carrier Name"),@"value":carrierName}, 85 | @{@"name":HLLocalized(@"Network Type"),@"value":networkType}, 86 | @{@"name":HLLocalized(@"Public IP"),@"value":pubIP}, 87 | @{@"name":HLLocalized(@"Internal IP"),@"value":internalIP}, 88 | @{@"name":HLLocalized(@"WIFI Name"),@"value":wifiName}, 89 | @{@"name":HLLocalized(@"WIFI MAC Address"),@"value":wifiMacAddress}, 90 | @{@"name":HLLocalized(@"DNS"),@"value":dns}, 91 | ]]]; 92 | // [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone]; 93 | 94 | } 95 | 96 | - (void)refreshNetworkFlow { 97 | //section1 98 | NSString *uplinkData = _network.dataOutFlow; 99 | NSString *downlinkData = _network.dataInFlow; 100 | NSString *uplinkWIFI = _network.wifiOutFlow; 101 | NSString *downlinkWIFI = _network.wifiInFlow; 102 | [self.datasource replaceObjectsInRange:NSMakeRange(2, 1) withObjectsFromArray:@[@[@{@"name":HLLocalized(@"Uplink Cell Data"),@"value":uplinkData}, 103 | @{@"name":HLLocalized(@"Downlink Cell Data"),@"value":downlinkData}, 104 | @{@"name":HLLocalized(@"Uplink WIFI"),@"value":uplinkWIFI}, 105 | @{@"name":HLLocalized(@"Downlink WIFI"),@"value":downlinkWIFI}, 106 | ]]]; 107 | // [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:2] withRowAnimation:UITableViewRowAnimationNone]; 108 | 109 | } 110 | 111 | - (void)refreshNetworkSpeed { 112 | [self refreshNetworkFlow]; 113 | 114 | //section2 115 | NSString *uploadSpeed = _network.uploadNetworkSpeed; 116 | NSString *downloadSpeed = _network.downloadNetworkSpeed; 117 | [self.datasource replaceObjectsInRange:NSMakeRange(1, 1) withObjectsFromArray:@[@[@{@"name":HLLocalized(@"Uplink Speed"),@"value":uploadSpeed}, 118 | @{@"name":HLLocalized(@"Downlink Speed"),@"value":downloadSpeed}, 119 | ]]]; 120 | [self.tableView reloadData]; 121 | // [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationNone]; 122 | } 123 | 124 | #pragma mark - Delegate 125 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 126 | return self.datasource.count; 127 | } 128 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 129 | return [self.datasource[section] count]; 130 | } 131 | 132 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 133 | HLDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[HLDetailTableViewCell reuseIdentifier]]; 134 | 135 | NSDictionary *dic = self.datasource[indexPath.section][indexPath.row]; 136 | [cell configData:dic]; 137 | return cell; 138 | } 139 | 140 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 141 | NSString *text = @""; 142 | switch (section) { 143 | case 0: 144 | text = HLLocalized(@"Network Basic Info"); 145 | break; 146 | case 1: 147 | text = HLLocalized(@"RealTime Net Speed"); 148 | break; 149 | case 2: 150 | text = HLLocalized(@"Network Flow"); 151 | break; 152 | default: 153 | break; 154 | } 155 | return text; 156 | } 157 | #pragma mark - Getter 158 | 159 | - (UITableView *)tableView { 160 | if (_tableView == nil) { 161 | _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; 162 | _tableView.delegate = self; 163 | _tableView.dataSource = self; 164 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 165 | 166 | } 167 | return _tableView; 168 | } 169 | @end 170 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/Detail/HLPhoneDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLPhoneDetailViewController.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/13. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLPhoneDetailViewController : HLBaseViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/Detail/HLPhoneDetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLPhoneDetailViewController.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/13. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLPhoneDetailViewController.h" 10 | 11 | @interface HLPhoneDetailViewController () 12 | 13 | @property (nonatomic, strong) UITableView *tableView; 14 | @property (nonatomic, strong) NSArray *datasource; 15 | @end 16 | 17 | @implementation HLPhoneDetailViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | self.title = HLLocalized(@"Device"); 22 | self.tableView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xF8F8F8,0x111111); 23 | self.view.dk_backgroundColorPicker = DKColorPickerWithRGB(0xF8F8F8,0x111111); 24 | 25 | [self.view addSubview:self.tableView]; 26 | [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { 27 | make.top.mas_equalTo(K_NAVBAR_HEIGHT); 28 | make.left.right.mas_equalTo(0); 29 | make.bottom.mas_equalTo(0); 30 | }]; 31 | [self.tableView registerClass:[HLDetailTableViewCell class] forCellReuseIdentifier:[HLDetailTableViewCell reuseIdentifier]]; 32 | 33 | [self configData]; 34 | } 35 | 36 | - (void)viewWillAppear:(BOOL)animated { 37 | [super viewWillAppear:animated]; 38 | [self.navigationController setNavigationBarHidden:NO animated:NO]; 39 | } 40 | 41 | - (void)configData { 42 | NSString *iphoneName = [NSString stringWithFormat:@"%@", [HLDeviceInformation getiPhoneName]]; 43 | NSString *deviceName = [HLDeviceInformation getDeviceName]; 44 | NSString *deviceModel = [HLDeviceInformation getDeviceModel]; 45 | NSString *systemVersion = [HLDeviceInformation getSystemVersion]; 46 | NSString *systemBuild = [HLDeviceInformation getSystemBuildVersion]; 47 | 48 | NSString *screenWidth = [HLDeviceInformation getDeviceScreenWidth]; 49 | NSString *screenHeight = [HLDeviceInformation getDeviceScreenHeight]; 50 | NSString *pixels = [HLDeviceInformation getDevicePixels]; 51 | NSString *ppi = [NSString stringWithFormat:@"%@PPI", [[HLDeviceInformation sharedInstance].deviceDict objectForKey:@"PPI"]]; 52 | NSString *systemLanguage = [HLDeviceInformation getDeviceLanguage]; 53 | NSString *systemUpTime = [HLDeviceInformation sharedInstance].upTime; 54 | NSString *rebootDate = [HLDeviceInformation sharedInstance].bootTime; 55 | NSString *timeZone = [HLDeviceInformation getTimezone]; 56 | 57 | self.datasource = @[@[@{@"name":HLLocalized(@"Device Name"),@"value":iphoneName},//手机名称 58 | @{@"name":HLLocalized(@"Device Type"),@"value":deviceName},//设备名称设备型号 59 | @{@"name":HLLocalized(@"Device Model"),@"value":deviceModel},//设备型号 60 | @{@"name":HLLocalized(@"OS Version"),@"value":systemVersion}, 61 | @{@"name":HLLocalized(@"Build Version"),@"value":systemBuild} 62 | ], 63 | @[@{@"name":HLLocalized(@"Width"),@"value":screenWidth}, 64 | @{@"name":HLLocalized(@"Height"),@"value":screenHeight}, 65 | @{@"name":HLLocalized(@"Pixels"),@"value":pixels}, 66 | @{@"name":HLLocalized(@"PPI"),@"value":ppi} 67 | ], 68 | @[@{@"name":HLLocalized(@"System Language"),@"value":systemLanguage}, 69 | @{@"name":HLLocalized(@"TimeZone"),@"value":timeZone}, 70 | @{@"name":HLLocalized(@"Reboot Date"),@"value":rebootDate}, 71 | @{@"name":HLLocalized(@"SystemUpTime"),@"value":systemUpTime} 72 | ] 73 | ]; 74 | [self.tableView reloadData]; 75 | } 76 | 77 | #pragma mark - Delegate 78 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 79 | return self.datasource.count; 80 | } 81 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 82 | return [self.datasource[section] count]; 83 | } 84 | 85 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 86 | HLDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[HLDetailTableViewCell reuseIdentifier]]; 87 | 88 | NSDictionary *dic = self.datasource[indexPath.section][indexPath.row]; 89 | [cell configData:dic]; 90 | return cell; 91 | } 92 | 93 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 94 | NSString *text = @""; 95 | switch (section) { 96 | case 0: 97 | text = HLLocalized(@"System"); 98 | break; 99 | case 1: 100 | text = HLLocalized(@"Screen"); 101 | break; 102 | case 2: 103 | text = HLLocalized(@"Others"); 104 | break; 105 | default: 106 | break; 107 | } 108 | return text; 109 | } 110 | #pragma mark - Getter 111 | 112 | - (UITableView *)tableView { 113 | if (_tableView == nil) { 114 | _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; 115 | _tableView.delegate = self; 116 | _tableView.dataSource = self; 117 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 118 | 119 | } 120 | return _tableView; 121 | } 122 | @end 123 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/Detail/HLRAMDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLRAMDetailViewController.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/13. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLRAMDetailViewController : HLBaseViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/Detail/HLRAMDetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLRAMDetailViewController.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/13. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLRAMDetailViewController.h" 10 | 11 | @interface HLRAMDetailViewController () 12 | 13 | @property (nonatomic, strong) UITableView *tableView; 14 | @property (nonatomic, strong) NSArray *datasource; 15 | @property (nonatomic, strong) NSTimer *timer; 16 | 17 | @property (nonatomic, strong) NSString *memType; 18 | @property (nonatomic, strong) NSString *memIOSpeed; 19 | @property (nonatomic, strong) NSString *totalMem; 20 | 21 | @end 22 | 23 | @implementation HLRAMDetailViewController 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | self.title = HLLocalized(@"Memory"); 28 | 29 | self.tableView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xF8F8F8,0x111111); 30 | self.view.dk_backgroundColorPicker = DKColorPickerWithRGB(0xF8F8F8,0x111111); 31 | 32 | [self.view addSubview:self.tableView]; 33 | [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { 34 | make.top.mas_equalTo(K_NAVBAR_HEIGHT); 35 | make.left.right.mas_equalTo(0); 36 | make.bottom.mas_equalTo(0); 37 | }]; 38 | [self.tableView registerClass:[HLDetailTableViewCell class] forCellReuseIdentifier:[HLDetailTableViewCell reuseIdentifier]]; 39 | 40 | self.memType = [[HLDeviceInformation sharedInstance].deviceDict objectForKey:@"MemType"]; 41 | self.memIOSpeed = [[HLDeviceInformation sharedInstance].deviceDict objectForKey:@"RAM Speed"]; 42 | self.totalMem = [[HLDeviceInformation sharedInstance].deviceDict objectForKey:@"RAM"]; 43 | 44 | [self configData]; 45 | 46 | _timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(configData) userInfo:nil repeats:YES]; 47 | [[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSDefaultRunLoopMode]; 48 | [_timer fire]; 49 | } 50 | 51 | - (void)configData { 52 | NSString *appMemUsed = [HLMemoryMonitor monitor].appMemoryUsage; 53 | NSString *idleMemUsed = [HLMemoryMonitor monitor].freeMemory; 54 | NSString *inactiveMem = [HLMemoryMonitor monitor].inactiveMemory; 55 | NSString *wiredMemo = [HLMemoryMonitor monitor].wiredMemory; 56 | NSString *activeMemLabel= [HLMemoryMonitor monitor].activeMemory; 57 | NSString *otherMemory = [NSString stringWithFormat:@"%0.2fMB",[HLMemoryMonitor monitor].otherMemory]; 58 | 59 | self.datasource = @[@[@{@"name":HLLocalized(@"Memory Type"),@"value":self.memType},//内存型号 60 | @{@"name":HLLocalized(@"Read/Write Freq"),@"value":self.memIOSpeed},//读写频率 61 | @{@"name":HLLocalized(@"Total Memory"),@"value":self.totalMem}, 62 | ], 63 | @[ 64 | @{@"name":HLLocalized(@"Idle"),@"value":idleMemUsed}, 65 | @{@"name":HLLocalized(@"Inactive"),@"value":inactiveMem} 66 | ], 67 | @[ 68 | @{@"name":HLLocalized(@"App Used"),@"value":appMemUsed}, 69 | @{@"name":HLLocalized(@"Wired"),@"value":wiredMemo}, 70 | @{@"name":HLLocalized(@"Active"),@"value":activeMemLabel}, 71 | @{@"name":HLLocalized(@"Other Memory"),@"value":otherMemory} 72 | ] 73 | ]; 74 | [self.tableView reloadData]; 75 | } 76 | 77 | - (void)viewWillAppear:(BOOL)animated { 78 | [super viewWillAppear:animated]; 79 | [self.navigationController setNavigationBarHidden:NO animated:NO]; 80 | } 81 | 82 | #pragma mark - Delegate 83 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 84 | return self.datasource.count; 85 | } 86 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 87 | return [self.datasource[section] count]; 88 | } 89 | 90 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 91 | HLDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[HLDetailTableViewCell reuseIdentifier]]; 92 | 93 | NSDictionary *dic = self.datasource[indexPath.section][indexPath.row]; 94 | [cell configData:dic]; 95 | return cell; 96 | } 97 | 98 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 99 | NSString *text = @""; 100 | switch (section) { 101 | case 0: 102 | text = HLLocalized(@"Memory Info"); 103 | break; 104 | case 1: 105 | text = HLLocalized(@"Aval. Memory"); 106 | break; 107 | case 2: 108 | text = HLLocalized(@"Used. Memory"); 109 | break; 110 | default: 111 | break; 112 | } 113 | return text; 114 | } 115 | #pragma mark - Getter 116 | 117 | - (UITableView *)tableView { 118 | if (_tableView == nil) { 119 | _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; 120 | _tableView.delegate = self; 121 | _tableView.dataSource = self; 122 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 123 | 124 | } 125 | return _tableView; 126 | } 127 | @end 128 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/HLDeviceViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/3. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseViewController.h" 10 | 11 | @interface HLDeviceViewController : HLBaseViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/HLPrivacyViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLPrivacyViewController.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLBaseViewController.h" 10 | 11 | @interface HLPrivacyViewController : HLBaseViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/HLPrivacyViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLPrivacyViewController.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLPrivacyViewController.h" 10 | #import 11 | 12 | @interface HLPrivacyViewController () 13 | @property (nonatomic, strong) UIActivityIndicatorView *activityView; 14 | 15 | @property (nonatomic, weak) IBOutlet UITextView *textview; 16 | 17 | @end 18 | 19 | @implementation HLPrivacyViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | self.title = HLLocalized(@"Privacy"); 24 | self.view.dk_backgroundColorPicker = DKColorPickerWithRGB(0xF8F8F8,0x111111); 25 | self.textview.dk_backgroundColorPicker = DKColorPickerWithRGB(0xF8F8F8,0x111111); 26 | 27 | if (@available(iOS 11.0, *)) { 28 | self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever; 29 | // Do any additional setup after loading the view. 30 | } else { 31 | // Fallback on earlier versions 32 | } 33 | 34 | self.textview.text = HLLocalized(@"PrivacyContent"); 35 | 36 | } 37 | // 38 | //- (void)setupProgressView { 39 | // 40 | // self.activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 41 | // self.activityView.size = CGSizeMake(50, 50); 42 | // self.activityView.center = self.view.center; 43 | // [self.view addSubview:self.activityView]; 44 | //} 45 | 46 | - (IBAction)close:(id)sender { 47 | if (self.navigationController) { 48 | [self.navigationController popViewControllerAnimated:YES]; 49 | return; 50 | } 51 | [self dismissViewControllerAnimated:YES completion:nil]; 52 | } 53 | 54 | //- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { 55 | // if ([keyPath isEqualToString:@"estimatedProgress"]) { 56 | // CGFloat progerss = [[change valueForKey:NSKeyValueChangeNewKey] floatValue]; 57 | // [self.activityView startAnimating]; 58 | // if (progerss >= 0.5) { 59 | // [self.activityView stopAnimating]; 60 | // self.activityView.hidden = YES; 61 | // } 62 | // } 63 | //} 64 | 65 | - (void)didReceiveMemoryWarning { 66 | [super didReceiveMemoryWarning]; 67 | // Dispose of any resources that can be recreated. 68 | } 69 | 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /kajslkd/Class/ViewController/HLSettingViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLSettingViewController.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/9. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseTableViewController.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLSettingViewController : HLBaseTableViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLBaseNavViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLBaseNavViewController.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/9. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HLBaseNavViewController : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLBaseNavViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLBaseNavViewController.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/9. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLBaseNavViewController.h" 10 | #import "UINavigationBar+Awesome.h" 11 | 12 | @interface HLBaseNavViewController () 13 | 14 | @end 15 | 16 | @implementation HLBaseNavViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view. 21 | // self.view.backgroundColor = [UIColor whiteColor]; 22 | self.navigationBar.tintColor = [UIColor darkGrayColor]; 23 | //设置导航栏透明 24 | [self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 25 | [self.navigationBar setShadowImage:[UIImage new]]; 26 | [self themeChanged]; 27 | //先调用一下 28 | // [self.navigationBar lt_setBackgroundColor:[UIColor whiteColor]]; 29 | //监听主题变化通知, 修改导航栏title color 30 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(themeChanged) name:DKNightVersionThemeChangingNotification object:nil]; 31 | } 32 | 33 | - (void)themeChanged { 34 | DKNightVersionManager *manager = [DKNightVersionManager sharedManager]; 35 | if ([manager.themeVersion isEqualToString:DKThemeVersionNormal]) { 36 | [self.navigationBar setTitleTextAttributes:@{ NSForegroundColorAttributeName:[UIColor blackColor]}]; 37 | 38 | }else if ([manager.themeVersion isEqualToString:DKThemeVersionNight]){ 39 | [self.navigationBar setTitleTextAttributes:@{ NSForegroundColorAttributeName:[UIColor whiteColor]}]; 40 | } 41 | } 42 | 43 | - (void)didReceiveMemoryWarning { 44 | [super didReceiveMemoryWarning]; 45 | // Dispose of any resources that can be recreated. 46 | } 47 | 48 | - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { 49 | if (self.childViewControllers.count==1) { 50 | viewController.hidesBottomBarWhenPushed = YES; //viewController是将要被push的控制器 51 | } 52 | [super pushViewController:viewController animated:animated]; 53 | } 54 | 55 | - (UIStatusBarStyle)preferredStatusBarStyle { 56 | BOOL isNight = [[NSUserDefaults standardUserDefaults] boolForKey:@"AppInNight"]; 57 | return isNight?UIStatusBarStyleLightContent:UIStatusBarStyleDefault; 58 | } 59 | @end 60 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLBaseTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLBaseTableViewCell.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HLBaseTableViewProtocol.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface HLBaseTableViewCell : UITableViewCell 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLBaseTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLBaseTableViewCell.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLBaseTableViewCell.h" 10 | @interface HLBaseTableViewCell () 11 | 12 | @property (nonatomic, strong) UIView *bgView; 13 | @property (nonatomic, strong) UIView *line; 14 | 15 | @end 16 | @implementation HLBaseTableViewCell 17 | 18 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 19 | if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { 20 | [self configSubViews]; 21 | [self configLayout]; 22 | [self configData]; 23 | self.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFFFF,0x111111); 24 | self.selectionStyle = UITableViewCellSelectionStyleNone; 25 | } 26 | return self; 27 | } 28 | 29 | - (void)awakeFromNib { 30 | [super awakeFromNib]; 31 | [self configSubViews]; 32 | [self configLayout]; 33 | [self configData]; 34 | self.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFFFF,0x111111); 35 | self.selectionStyle = UITableViewCellSelectionStyleNone; 36 | 37 | } 38 | 39 | - (void)configSubViews { 40 | // [self.contentView addSubview:self.bgView]; 41 | // [self.contentView addSubview:self.line]; 42 | } 43 | 44 | - (void)configLayout { 45 | // [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { 46 | // make.left.mas_equalTo(12); 47 | // make.right.mas_equalTo(-12); 48 | // make.top.mas_equalTo(10); 49 | // make.bottom.mas_equalTo(-10); 50 | // }]; 51 | // [self.line mas_makeConstraints:^(MASConstraintMaker *make) { 52 | // make.height.mas_equalTo(1); 53 | // make.left.mas_equalTo(64); 54 | // make.right.mas_equalTo(-12); 55 | // make.bottom.mas_equalTo(-1); 56 | // }]; 57 | } 58 | 59 | - (void)configData { 60 | // [self setNeedsLayout]; 61 | // [self layoutIfNeeded]; 62 | // [self.bgView.layer applySketchShadow:[UIColor blackColor] alpha:0.5 x:0 y:3 blur:10 spread:0]; 63 | } 64 | 65 | + (NSString *)reuseIdentifier { 66 | return NSStringFromClass([self class]); 67 | } 68 | 69 | - (UIView *)bgView { 70 | if (_bgView == nil) { 71 | _bgView = [UIView new]; 72 | _bgView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFFFF,0x111111); 73 | _bgView.layer.cornerRadius = 10; 74 | _bgView.layer.masksToBounds = YES; 75 | } 76 | return _bgView; 77 | } 78 | 79 | - (UIView *)line { 80 | if (_line == nil) { 81 | _line = [UIView new]; 82 | _line.backgroundColor = [UIColor colorWithHex:@"F8F8F8"]; 83 | } 84 | return _line; 85 | } 86 | @end 87 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLBaseTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLBaseTableViewController.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HLBaseTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLBaseTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLBaseTableViewController.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLBaseTableViewController.h" 10 | 11 | @interface HLBaseTableViewController () 12 | 13 | @end 14 | 15 | @implementation HLBaseTableViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | } 20 | 21 | - (void)viewWillAppear:(BOOL)animated { 22 | [super viewWillAppear:animated]; 23 | } 24 | 25 | - (void)viewDidDisappear:(BOOL)animated { 26 | [super viewDidDisappear:animated]; 27 | } 28 | 29 | - (void)dealloc { 30 | NSLog(@"%@ dealloc!",NSStringFromClass([self class])); 31 | } 32 | 33 | - (void)didReceiveMemoryWarning { 34 | [super didReceiveMemoryWarning]; 35 | // Dispose of any resources that can be recreated. 36 | } 37 | 38 | /* 39 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 40 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath]; 41 | 42 | // Configure the cell... 43 | 44 | return cell; 45 | } 46 | */ 47 | 48 | /* 49 | // Override to support conditional editing of the table view. 50 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { 51 | // Return NO if you do not want the specified item to be editable. 52 | return YES; 53 | } 54 | */ 55 | 56 | /* 57 | // Override to support editing the table view. 58 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 59 | if (editingStyle == UITableViewCellEditingStyleDelete) { 60 | // Delete the row from the data source 61 | [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; 62 | } else if (editingStyle == UITableViewCellEditingStyleInsert) { 63 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 64 | } 65 | } 66 | */ 67 | 68 | /* 69 | // Override to support rearranging the table view. 70 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { 71 | } 72 | */ 73 | 74 | /* 75 | // Override to support conditional rearranging of the table view. 76 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { 77 | // Return NO if you do not want the item to be re-orderable. 78 | return YES; 79 | } 80 | */ 81 | 82 | /* 83 | #pragma mark - Navigation 84 | 85 | // In a storyboard-based application, you will often want to do a little preparation before navigation 86 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 87 | // Get the new view controller using [segue destinationViewController]. 88 | // Pass the selected object to the new view controller. 89 | } 90 | */ 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLBaseTableViewProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLBaseTableViewProtocol.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HLSystemMonitor.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @protocol HLBaseTableViewProtocol 15 | 16 | - (void)configSubViews; 17 | - (void)configLayout; 18 | - (void)configData; 19 | 20 | + (NSString *)reuseIdentifier; 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLBaseViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLBaseViewController.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HLBaseViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLBaseViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLBaseViewController.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLBaseViewController.h" 10 | 11 | @interface HLBaseViewController () 12 | 13 | @end 14 | 15 | @implementation HLBaseViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | } 21 | 22 | - (void)viewWillAppear:(BOOL)animated { 23 | [super viewWillAppear:animated]; 24 | } 25 | 26 | - (void)viewDidDisappear:(BOOL)animated { 27 | [super viewDidDisappear:animated]; 28 | } 29 | 30 | - (void)dealloc { 31 | NSLog(@"%@ dealloc!",NSStringFromClass([self class])); 32 | } 33 | - (void)didReceiveMemoryWarning { 34 | [super didReceiveMemoryWarning]; 35 | // Dispose of any resources that can be recreated. 36 | } 37 | 38 | - (UIStatusBarStyle)preferredStatusBarStyle { 39 | BOOL isNight = [[NSUserDefaults standardUserDefaults] boolForKey:@"AppInNight"]; 40 | return isNight?UIStatusBarStyleLightContent:UIStatusBarStyleDefault; 41 | } 42 | /* 43 | #pragma mark - Navigation 44 | 45 | // In a storyboard-based application, you will often want to do a little preparation before navigation 46 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 47 | // Get the new view controller using [segue destinationViewController]. 48 | // Pass the selected object to the new view controller. 49 | } 50 | */ 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLTabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLTabBarController.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HLTabBarController : UITabBarController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /kajslkd/Common/Base/HLTabBarController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLTabBarController.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLTabBarController.h" 10 | 11 | @interface HLTabBarController () 12 | 13 | @end 14 | 15 | @implementation HLTabBarController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | self.view.backgroundColor = [UIColor whiteColor]; 21 | 22 | UITabBarItem *item1 = [self.tabBar.items objectAtIndex:0]; 23 | UITabBarItem *item2 = [self.tabBar.items objectAtIndex:1]; 24 | UITabBarItem *item3 = [self.tabBar.items objectAtIndex:2]; 25 | 26 | item1.selectedImage = [[UIImage imageNamed:@"device_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 27 | item1.image = [[UIImage imageNamed:@"device_unselect"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 28 | item2.selectedImage = [[UIImage imageNamed:@"tools_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 29 | item2.image = [[UIImage imageNamed:@"tools_unselect"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 30 | item3.selectedImage = [[UIImage imageNamed:@"setting_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 31 | item3.image = [[UIImage imageNamed:@"setting_unselect"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 32 | //改变UITabBarItem字体颜色 33 | [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor],NSForegroundColorAttributeName, nil] forState:UIControlStateSelected]; 34 | [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor lightGrayColor],NSForegroundColorAttributeName, nil] forState:UIControlStateNormal]; 35 | } 36 | 37 | - (void)didReceiveMemoryWarning { 38 | [super didReceiveMemoryWarning]; 39 | // Dispose of any resources that can be recreated. 40 | } 41 | 42 | /* 43 | #pragma mark - Navigation 44 | 45 | // In a storyboard-based application, you will often want to do a little preparation before navigation 46 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 47 | // Get the new view controller using [segue destinationViewController]. 48 | // Pass the selected object to the new view controller. 49 | } 50 | */ 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /kajslkd/Common/Category/CALayer+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer+Extension.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface CALayer (Extension) 14 | 15 | - (void)applySketchShadow:(UIColor *)color 16 | alpha:(CGFloat)alpha 17 | x:(CGFloat)x 18 | y:(CGFloat)y 19 | blur:(CGFloat)blur 20 | spread:(CGFloat)spread; 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /kajslkd/Common/Category/CALayer+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer+Extension.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/6. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "CALayer+Extension.h" 10 | #import 11 | 12 | @implementation CALayer (Extension) 13 | 14 | - (void)applySketchShadow:(UIColor *)color 15 | alpha:(CGFloat)alpha 16 | x:(CGFloat)x 17 | y:(CGFloat)y 18 | blur:(CGFloat)blur 19 | spread:(CGFloat)spread { 20 | self.shadowColor = color?color.CGColor:[UIColor blackColor].CGColor; 21 | self.shadowOpacity = alpha; 22 | self.shadowOffset = CGSizeMake(x, y); 23 | self.shadowRadius = blur / 2.0; 24 | if (spread == 0) { 25 | self.shadowPath = nil; 26 | }else { 27 | CGFloat dx = -spread; 28 | CGRect rect = CGRectMake(self.bounds.origin.x+dx, self.bounds.origin.y+dx, self.bounds.size.width+dx*2, self.bounds.size.height+dx*2); 29 | self.shadowPath = [UIBezierPath bezierPathWithRect:rect].CGPath; 30 | } 31 | 32 | } 33 | @end 34 | -------------------------------------------------------------------------------- /kajslkd/Common/Category/UIColor+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Extension.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/18. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIColor (Extension) 14 | 15 | + (UIColor *)colorWithHex:(NSString *)color; 16 | + (UIColor *)colorWithRGBA:(NSString *)rgba; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /kajslkd/Common/Category/UIColor+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Extension.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/18. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "UIColor+Extension.h" 10 | 11 | @implementation UIColor (Extension) 12 | 13 | + (UIColor *)colorWithHex:(NSString *)color 14 | { 15 | NSArray *colorArray = [self colorArrayWithHexString:color]; 16 | if (colorArray.count >= 3) { 17 | CGFloat red = [colorArray[0] floatValue]; 18 | CGFloat green = [colorArray[1] floatValue]; 19 | CGFloat blue = [colorArray[2] floatValue]; 20 | CGFloat alpha = [colorArray[3] floatValue]; 21 | return [UIColor colorWithRed:(red / 255.0f) green:(green / 255.0f) blue:(blue / 255.0f) alpha:(alpha / 255.0f)]; 22 | } 23 | return [UIColor clearColor]; 24 | 25 | } 26 | 27 | + (UIColor *)colorWithRGBA:(NSString *)rgba { 28 | NSMutableArray *colorArray = [NSMutableArray arrayWithArray:[rgba componentsSeparatedByString:@","]]; 29 | if (colorArray.count < 3 || colorArray.count > 4) { 30 | return [UIColor clearColor]; 31 | } 32 | if (colorArray.count == 3) { 33 | [colorArray addObject:@(1)]; 34 | } 35 | CGFloat red = [colorArray[0] floatValue]; 36 | CGFloat green = [colorArray[1] floatValue]; 37 | CGFloat blue = [colorArray[2] floatValue]; 38 | CGFloat alpha = [colorArray[3] floatValue]; 39 | return [UIColor colorWithRed:(red / 255.0f) green:(green / 255.0f) blue:(blue / 255.0f) alpha:alpha]; 40 | } 41 | 42 | + (NSArray *)colorArrayWithHexString:(NSString *)hexString { 43 | // 转为大写 44 | NSString *colorString = [[hexString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString]; 45 | // 字符串长度为7-10位,如:#FFFFFF #FFFFFFAA 0xFFFFFF 0xFFFFFFAA 46 | if (colorString.length < 6) { 47 | return @[]; 48 | } 49 | 50 | // 0X开头 51 | if ([colorString hasPrefix:@"0X"] || [colorString hasPrefix:@"0x"]) { 52 | colorString = [colorString substringFromIndex:2]; 53 | } 54 | if ([colorString hasPrefix:@"#"]) { 55 | colorString = [colorString substringFromIndex:1]; 56 | } 57 | if (!(colorString.length == 6 ||colorString.length == 8)) { 58 | return @[]; 59 | } 60 | 61 | if (colorString.length == 6) { 62 | colorString = [@"FF" stringByAppendingString:colorString]; 63 | } 64 | // 分解颜色为R, G, B, A 65 | NSRange range; 66 | range.location = 0; 67 | range.length = 2; 68 | 69 | // Alpha 70 | NSString *alphaString = [colorString substringWithRange:range]; 71 | 72 | // Red 73 | range.location = 2; 74 | NSString *rString = [colorString substringWithRange:range]; 75 | 76 | // Green 77 | range.location = 4; 78 | NSString *gString = [colorString substringWithRange:range]; 79 | 80 | // Blue 81 | range.location = 6; 82 | NSString *bString = [colorString substringWithRange:range]; 83 | 84 | // 扫描值 85 | unsigned int r, g, b, a; 86 | [[NSScanner scannerWithString:alphaString] scanHexInt:&a]; 87 | [[NSScanner scannerWithString:rString] scanHexInt:&r]; 88 | [[NSScanner scannerWithString:gString] scanHexInt:&g]; 89 | [[NSScanner scannerWithString:bString] scanHexInt:&b]; 90 | return @[@(r), @(g), @(b), @(a)]; 91 | } 92 | @end 93 | -------------------------------------------------------------------------------- /kajslkd/Common/Category/UINavigationBar+Awesome.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+Awesome.h 3 | // LTNavigationBar 4 | // 5 | // Created by ltebean on 15-2-15. 6 | // Copyright (c) 2015 ltebean. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UINavigationBar (Awesome) 12 | - (void)lt_setBackgroundColor:(UIColor *)backgroundColor; 13 | - (void)lt_setElementsAlpha:(CGFloat)alpha; 14 | - (void)lt_setTranslationY:(CGFloat)translationY; 15 | - (void)lt_reset; 16 | @end 17 | -------------------------------------------------------------------------------- /kajslkd/Common/Category/UINavigationBar+Awesome.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+Awesome.m 3 | // LTNavigationBar 4 | // 5 | // Created by ltebean on 15-2-15. 6 | // Copyright (c) 2015 ltebean. All rights reserved. 7 | // 8 | 9 | #import "UINavigationBar+Awesome.h" 10 | #import 11 | 12 | @implementation UINavigationBar (Awesome) 13 | static char overlayKey; 14 | 15 | - (UIView *)overlay 16 | { 17 | return objc_getAssociatedObject(self, &overlayKey); 18 | } 19 | 20 | - (void)setOverlay:(UIView *)overlay 21 | { 22 | objc_setAssociatedObject(self, &overlayKey, overlay, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 23 | } 24 | 25 | - (void)lt_setBackgroundColor:(UIColor *)backgroundColor 26 | { 27 | if (!self.overlay) { 28 | [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 29 | UIView *backgroundView = [self KPGetBackgroundView]; 30 | self.overlay = [[UIView alloc] initWithFrame:backgroundView.bounds]; 31 | self.overlay.userInteractionEnabled = NO; 32 | self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; 33 | [backgroundView insertSubview:self.overlay atIndex:0]; 34 | } 35 | self.overlay.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFFFF,0x111111); 36 | // self.overlay.backgroundColor = backgroundColor; 37 | } 38 | 39 | - (UIView*)KPGetBackgroundView 40 | { 41 | //iOS10之前为 _UINavigationBarBackground, iOS10为 _UIBarBackground 42 | //_UINavigationBarBackground实际为UIImageView子类,而_UIBarBackground是UIView子类 43 | //之前setBackgroundImage直接赋值给_UINavigationBarBackground,现在则是设置后为_UIBarBackground增加一个UIImageView子控件方式去呈现图片 44 | 45 | if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) { 46 | UIView *_UIBackground; 47 | NSString *targetName = @"_UIBarBackground"; 48 | Class _UIBarBackgroundClass = NSClassFromString(targetName); 49 | 50 | for (UIView *subview in self.subviews) { 51 | if ([subview isKindOfClass:_UIBarBackgroundClass.class]) { 52 | _UIBackground = subview; 53 | break; 54 | } 55 | } 56 | return _UIBackground; 57 | } 58 | else { 59 | UIView *_UINavigationBarBackground; 60 | NSString *targetName = @"_UINavigationBarBackground"; 61 | Class _UINavigationBarBackgroundClass = NSClassFromString(targetName); 62 | 63 | for (UIView *subview in self.subviews) { 64 | if ([subview isKindOfClass:_UINavigationBarBackgroundClass.class]) { 65 | _UINavigationBarBackground = subview; 66 | break; 67 | } 68 | } 69 | return _UINavigationBarBackground; 70 | } 71 | } 72 | 73 | - (void)lt_setTranslationY:(CGFloat)translationY 74 | { 75 | self.transform = CGAffineTransformMakeTranslation(0, translationY); 76 | } 77 | 78 | - (void)lt_setElementsAlpha:(CGFloat)alpha 79 | { 80 | [[self valueForKey:@"_leftViews"] enumerateObjectsUsingBlock:^(UIView *view, NSUInteger i, BOOL *stop) { 81 | view.alpha = alpha; 82 | }]; 83 | 84 | [[self valueForKey:@"_rightViews"] enumerateObjectsUsingBlock:^(UIView *view, NSUInteger i, BOOL *stop) { 85 | view.alpha = alpha; 86 | }]; 87 | 88 | UIView *titleView = [self valueForKey:@"_titleView"]; 89 | titleView.alpha = alpha; 90 | // when viewController first load, the titleView maybe nil 91 | [[self subviews] enumerateObjectsUsingBlock:^(UIView *obj, NSUInteger idx, BOOL *stop) { 92 | if ([obj isKindOfClass:NSClassFromString(@"UINavigationItemView")]) { 93 | obj.alpha = alpha; 94 | *stop = YES; 95 | } 96 | }]; 97 | } 98 | 99 | - (void)lt_reset 100 | { 101 | [self setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault]; 102 | [self.overlay removeFromSuperview]; 103 | self.overlay = nil; 104 | } 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /kajslkd/Common/Category/UIView+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/10/30. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIView (Extension) 14 | 15 | /** 16 | * Shortcut for frame.origin.x. 17 | * 18 | * Sets frame.origin.x = left 19 | */ 20 | @property (nonatomic) CGFloat left; 21 | 22 | /** 23 | * Shortcut for frame.origin.y 24 | * 25 | * Sets frame.origin.y = top 26 | */ 27 | @property (nonatomic) CGFloat top; 28 | 29 | /** 30 | * Shortcut for frame.origin.x + frame.size.width 31 | * 32 | * Sets frame.origin.x = right - frame.size.width 33 | */ 34 | @property (nonatomic) CGFloat right; 35 | 36 | /** 37 | * Shortcut for frame.origin.y + frame.size.height 38 | * 39 | * Sets frame.origin.y = bottom - frame.size.height 40 | */ 41 | @property (nonatomic) CGFloat bottom; 42 | 43 | /** 44 | * Shortcut for frame.size.width 45 | * 46 | * Sets frame.size.width = width 47 | */ 48 | @property (nonatomic) CGFloat width; 49 | 50 | /** 51 | * Shortcut for frame.size.height 52 | * 53 | * Sets frame.size.height = height 54 | */ 55 | @property (nonatomic) CGFloat height; 56 | 57 | /** 58 | * Shortcut for center.x 59 | * 60 | * Sets center.x = centerX 61 | */ 62 | @property (nonatomic) CGFloat centerX; 63 | 64 | /** 65 | * Shortcut for center.y 66 | * 67 | * Sets center.y = centerY 68 | */ 69 | @property (nonatomic) CGFloat centerY; 70 | 71 | /** 72 | * Return the x coordinate on the screen. 73 | */ 74 | @property (nonatomic, readonly) CGFloat ttScreenX; 75 | 76 | /** 77 | * Return the y coordinate on the screen. 78 | */ 79 | @property (nonatomic, readonly) CGFloat ttScreenY; 80 | 81 | /** 82 | * Return the x coordinate on the screen, taking into account scroll views. 83 | */ 84 | @property (nonatomic, readonly) CGFloat screenViewX; 85 | 86 | /** 87 | * Return the y coordinate on the screen, taking into account scroll views. 88 | */ 89 | @property (nonatomic, readonly) CGFloat screenViewY; 90 | 91 | /** 92 | * Return the view frame on the screen, taking into account scroll views. 93 | */ 94 | @property (nonatomic, readonly) CGRect screenFrame; 95 | 96 | /** 97 | * Shortcut for frame.origin 98 | */ 99 | @property (nonatomic) CGPoint origin; 100 | 101 | /** 102 | * Shortcut for frame.size 103 | */ 104 | @property (nonatomic) CGSize size; 105 | 106 | @end 107 | 108 | NS_ASSUME_NONNULL_END 109 | -------------------------------------------------------------------------------- /kajslkd/Common/Category/UIView+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extension.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/10/30. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "UIView+Extension.h" 10 | 11 | @implementation UIView (Extension) 12 | /////////////////////////////////////////////////////////////////////////////////////////////////// 13 | - (CGFloat)left { 14 | return self.frame.origin.x; 15 | } 16 | 17 | 18 | /////////////////////////////////////////////////////////////////////////////////////////////////// 19 | - (void)setLeft:(CGFloat)x { 20 | CGRect frame = self.frame; 21 | frame.origin.x = x; 22 | self.frame = frame; 23 | } 24 | 25 | 26 | /////////////////////////////////////////////////////////////////////////////////////////////////// 27 | - (CGFloat)top { 28 | return self.frame.origin.y; 29 | } 30 | 31 | 32 | /////////////////////////////////////////////////////////////////////////////////////////////////// 33 | - (void)setTop:(CGFloat)y { 34 | CGRect frame = self.frame; 35 | frame.origin.y = y; 36 | self.frame = frame; 37 | } 38 | 39 | 40 | /////////////////////////////////////////////////////////////////////////////////////////////////// 41 | - (CGFloat)right { 42 | return self.frame.origin.x + self.frame.size.width; 43 | } 44 | 45 | 46 | /////////////////////////////////////////////////////////////////////////////////////////////////// 47 | - (void)setRight:(CGFloat)right { 48 | CGRect frame = self.frame; 49 | frame.origin.x = right - frame.size.width; 50 | self.frame = frame; 51 | } 52 | 53 | 54 | /////////////////////////////////////////////////////////////////////////////////////////////////// 55 | - (CGFloat)bottom { 56 | return self.frame.origin.y + self.frame.size.height; 57 | } 58 | 59 | 60 | /////////////////////////////////////////////////////////////////////////////////////////////////// 61 | - (void)setBottom:(CGFloat)bottom { 62 | CGRect frame = self.frame; 63 | frame.origin.y = bottom - frame.size.height; 64 | self.frame = frame; 65 | } 66 | 67 | 68 | /////////////////////////////////////////////////////////////////////////////////////////////////// 69 | - (CGFloat)centerX { 70 | return self.center.x; 71 | } 72 | 73 | 74 | /////////////////////////////////////////////////////////////////////////////////////////////////// 75 | - (void)setCenterX:(CGFloat)centerX { 76 | self.center = CGPointMake(centerX, self.center.y); 77 | } 78 | 79 | 80 | /////////////////////////////////////////////////////////////////////////////////////////////////// 81 | - (CGFloat)centerY { 82 | return self.center.y; 83 | } 84 | 85 | 86 | /////////////////////////////////////////////////////////////////////////////////////////////////// 87 | - (void)setCenterY:(CGFloat)centerY { 88 | self.center = CGPointMake(self.center.x, centerY); 89 | } 90 | 91 | 92 | /////////////////////////////////////////////////////////////////////////////////////////////////// 93 | - (CGFloat)width { 94 | return self.frame.size.width; 95 | } 96 | 97 | 98 | /////////////////////////////////////////////////////////////////////////////////////////////////// 99 | - (void)setWidth:(CGFloat)width { 100 | CGRect frame = self.frame; 101 | frame.size.width = width; 102 | self.frame = frame; 103 | } 104 | 105 | 106 | /////////////////////////////////////////////////////////////////////////////////////////////////// 107 | - (CGFloat)height { 108 | return self.frame.size.height; 109 | } 110 | 111 | 112 | /////////////////////////////////////////////////////////////////////////////////////////////////// 113 | - (void)setHeight:(CGFloat)height { 114 | CGRect frame = self.frame; 115 | frame.size.height = height; 116 | self.frame = frame; 117 | } 118 | 119 | 120 | /////////////////////////////////////////////////////////////////////////////////////////////////// 121 | - (CGFloat)ttScreenX { 122 | CGFloat x = 0; 123 | for (UIView* view = self; view; view = view.superview) { 124 | x += view.left; 125 | } 126 | return x; 127 | } 128 | 129 | 130 | /////////////////////////////////////////////////////////////////////////////////////////////////// 131 | - (CGFloat)ttScreenY { 132 | CGFloat y = 0; 133 | for (UIView* view = self; view; view = view.superview) { 134 | y += view.top; 135 | } 136 | return y; 137 | } 138 | 139 | 140 | 141 | /////////////////////////////////////////////////////////////////////////////////////////////////// 142 | - (CGFloat)screenViewX { 143 | CGFloat x = 0; 144 | for (UIView* view = self; view; view = view.superview) { 145 | x += view.left; 146 | 147 | if ([view isKindOfClass:[UIScrollView class]]) { 148 | UIScrollView* scrollView = (UIScrollView*)view; 149 | x -= scrollView.contentOffset.x; 150 | } 151 | } 152 | 153 | return x; 154 | } 155 | 156 | 157 | /////////////////////////////////////////////////////////////////////////////////////////////////// 158 | - (CGFloat)screenViewY { 159 | CGFloat y = 0; 160 | for (UIView* view = self; view; view = view.superview) { 161 | y += view.top; 162 | 163 | if ([view isKindOfClass:[UIScrollView class]]) { 164 | UIScrollView* scrollView = (UIScrollView*)view; 165 | y -= scrollView.contentOffset.y; 166 | } 167 | } 168 | return y; 169 | } 170 | 171 | 172 | /////////////////////////////////////////////////////////////////////////////////////////////////// 173 | - (CGRect)screenFrame { 174 | return CGRectMake(self.screenViewX, self.screenViewY, self.width, self.height); 175 | } 176 | 177 | 178 | /////////////////////////////////////////////////////////////////////////////////////////////////// 179 | - (CGPoint)origin { 180 | return self.frame.origin; 181 | } 182 | 183 | 184 | /////////////////////////////////////////////////////////////////////////////////////////////////// 185 | - (void)setOrigin:(CGPoint)origin { 186 | CGRect frame = self.frame; 187 | frame.origin = origin; 188 | self.frame = frame; 189 | } 190 | 191 | 192 | /////////////////////////////////////////////////////////////////////////////////////////////////// 193 | - (CGSize)size { 194 | return self.frame.size; 195 | } 196 | 197 | 198 | /////////////////////////////////////////////////////////////////////////////////////////////////// 199 | - (void)setSize:(CGSize)size { 200 | CGRect frame = self.frame; 201 | frame.size = size; 202 | self.frame = frame; 203 | } 204 | @end 205 | -------------------------------------------------------------------------------- /kajslkd/Common/Category/UIViewController+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+Extension.h 3 | // OMTCoreKit 4 | // 5 | // Created by YZF on 2018/8/9. 6 | // 7 | 8 | #import 9 | 10 | @interface UIViewController (Extension) 11 | 12 | /// 当前显示的 ViewController 13 | + (UIViewController *)topViewController; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /kajslkd/Common/Category/UIViewController+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+Extension.m 3 | // OMTCoreKit 4 | // 5 | // Created by YZF on 2018/8/9. 6 | // 7 | 8 | #import "UIViewController+Extension.h" 9 | 10 | @implementation UIViewController (Extension) 11 | 12 | + (UIViewController *)topViewController { 13 | UIViewController *topVC = [UIApplication sharedApplication].keyWindow.rootViewController; 14 | while (topVC.presentedViewController) { 15 | topVC = topVC.presentedViewController; 16 | } 17 | 18 | if ([topVC isKindOfClass:[UITabBarController class]]) { 19 | topVC = [(UITabBarController *)topVC selectedViewController]; 20 | } 21 | if ([topVC isKindOfClass:[UINavigationController class]]){ 22 | topVC = [(UINavigationController *)topVC visibleViewController]; 23 | } 24 | 25 | return topVC; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /kajslkd/Common/HLMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLMacros.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #ifndef HLMacros_h 10 | #define HLMacros_h 11 | 12 | #define kHLDeviceWidth [UIScreen mainScreen].bounds.size.width 13 | #define kHLDeviceHeight [UIScreen mainScreen].bounds.size.height 14 | 15 | #define KAPPID @"1490127266" 16 | 17 | 18 | // 屏宽高 19 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 20 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 21 | #define kStatesNavHeight ([[UIApplication sharedApplication] statusBarFrame].size.height + 44) 22 | #define UIColorFromHex(rgbValue) [UIColor \ 23 | colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ 24 | green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ 25 | blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] 26 | 27 | #pragma mark - 28 | 29 | //#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) 30 | 31 | #define IOS13_OR_LATER ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 13.0 ) 32 | #define IOS12_OR_LATER ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 12.0 ) 33 | #define IOS11_OR_LATER ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0 ) 34 | #define IOS10_OR_LATER ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0 ) 35 | #define IOS9_OR_LATER ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0 ) 36 | #define IOS8_OR_LATER ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 ) 37 | #define IOS7_OR_LATER ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 ) 38 | #define IOS6_OR_LATER ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0 ) 39 | 40 | #define IOS12_OR_EARLIER ( !IOS13_OR_LATER ) 41 | #define IOS11_OR_EARLIER ( !IOS12_OR_LATER ) 42 | #define IOS10_OR_EARLIER ( !IOS11_OR_LATER ) 43 | #define IOS9_OR_EARLIER ( !IOS10_OR_LATER ) 44 | #define IOS8_OR_EARLIER ( !IOS9_OR_LATER ) 45 | #define IOS7_OR_EARLIER ( !IOS8_OR_LATER ) 46 | #define IOS6_OR_EARLIER ( !IOS7_OR_LATER ) 47 | #define IOS5_OR_EARLIER ( !IOS6_OR_LATER ) 48 | #define IOS4_OR_EARLIER ( !IOS5_OR_LATER ) 49 | #define IOS3_OR_EARLIER ( !IOS4_OR_LATER ) 50 | 51 | #define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 52 | #define IS_IPOD ([[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"]) 53 | #define IS_IPHONE ( !IS_IPAD ) 54 | 55 | #define IS_IPHONE4 (IS_SCREEN_35_INCH) 56 | #define IS_IPHONE5 (IS_SCREEN_4_INCH) 57 | #define IS_IPHONE6 (IS_SCREEN_47_INCH) 58 | #define IS_IPHONE6_PLUS (IS_SCREEN_55_INCH) 59 | #define IS_IPHONEX (IS_SCREEN_58_INCH) 60 | #define IS_IPHONEXR (IS_SCREEN_61_INCH) 61 | #define IS_IPHONEXS (IS_SCREEN_58_INCH &&) 62 | #define IS_IPHONEXSMAX (IS_SCREEN_65_INCH) 63 | 64 | #define IS_IPHONEX_SERIAL (IS_IPHONEX || IS_IPHONEXR || IS_IPHONEXSMAX) 65 | 66 | #define K_STATUSBAR_HEIGHT (IS_IPHONEX_SERIAL? 44.0f:20.0F) 67 | #define K_NAVBAR_HEIGHT (IS_IPHONEX_SERIAL? 88.0f:64.0f) 68 | #define K_BOTTOMBAR_HEIGHT (IS_IPHONEX_SERIAL? 83.0f:49.0f) 69 | #define K_BOTTOM_MARGIN_HEIGHT (IS_IPHONEX_SERIAL? 34.0f:0.0f) 70 | 71 | #define IS_SCREEN_65_INCH ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) : NO) 72 | 73 | #define IS_SCREEN_61_INCH ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) : NO) 74 | 75 | #define IS_SCREEN_58_INCH ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO) 76 | #define IS_SCREEN_55_INCH ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (CGSizeEqualToSize(CGSizeMake(1125, 2001), [[UIScreen mainScreen] currentMode].size) || CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size)) : NO) 77 | #define IS_SCREEN_47_INCH ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO) 78 | #define IS_SCREEN_4_INCH ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO) 79 | #define IS_SCREEN_35_INCH ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO) 80 | #define IS_SCREEN_IPAD_35_INCH ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(320, 480), [[UIScreen mainScreen] bounds].size) : NO) 81 | 82 | #define HLLocalized(key) [NSBundle.mainBundle localizedStringForKey:(key) value:(key) table:nil] 83 | 84 | #define UserDefaultSuite [[NSUserDefaults alloc] initWithSuiteName:@"group.com.hl1987.app.isystant-lite"] 85 | 86 | //#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) 87 | 88 | 89 | #ifndef weakify 90 | #if DEBUG 91 | #if __has_feature(objc_arc) 92 | #define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object; 93 | #else 94 | #define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object; 95 | #endif 96 | #else 97 | #if __has_feature(objc_arc) 98 | #define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object; 99 | #else 100 | #define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object; 101 | #endif 102 | #endif 103 | #endif 104 | 105 | #ifndef strongify 106 | #if DEBUG 107 | #if __has_feature(objc_arc) 108 | #define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object; 109 | #else 110 | #define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object; 111 | #endif 112 | #else 113 | #if __has_feature(objc_arc) 114 | #define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object; 115 | #else 116 | #define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object; 117 | #endif 118 | #endif 119 | #endif 120 | 121 | #endif /* HLMacros_h */ 122 | 123 | -------------------------------------------------------------------------------- /kajslkd/Common/HLPrivacyPolicy/HLPrivacyPolicy.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLPrivacyPolicy.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HLPrivacyPolicy : NSObject 12 | 13 | + (void)showPrivacyAlert; 14 | @end 15 | -------------------------------------------------------------------------------- /kajslkd/Common/HLPrivacyPolicy/HLPrivacyPolicy.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLPrivacyPolicy.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLPrivacyPolicy.h" 10 | 11 | @implementation HLPrivacyPolicy 12 | 13 | + (BOOL)hasShowPrivacyAlert { 14 | BOOL shown = [[NSUserDefaults standardUserDefaults] boolForKey:@"HLHasShowPrivacyAlert"] ; 15 | return shown; 16 | } 17 | + (void)showPrivacyAlert { 18 | BOOL hasShown = [[self class] hasShowPrivacyAlert]; 19 | if (hasShown) { 20 | return; 21 | } 22 | NSString *content = HLLocalized(@"PrivacyContent"); 23 | UIAlertController *alert = [UIAlertController alertControllerWithTitle:HLLocalized(@"Privacy") message:content preferredStyle:UIAlertControllerStyleAlert]; 24 | [alert addAction:[UIAlertAction actionWithTitle:HLLocalized(@"Agree") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 25 | 26 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HLHasShowPrivacyAlert"]; 27 | [[NSUserDefaults standardUserDefaults] synchronize]; 28 | }]]; 29 | [alert addAction:[UIAlertAction actionWithTitle:HLLocalized(@"Disagree") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { 30 | exit(0); 31 | }]]; 32 | 33 | [[UIViewController topViewController] presentViewController:alert animated:YES completion:nil]; 34 | 35 | } 36 | 37 | 38 | 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /kajslkd/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | LSRequiresIPhoneOS 22 | 23 | NSAppTransportSecurity 24 | 25 | NSAllowsArbitraryLoads 26 | 27 | 28 | NSLocationWhenInUseUsageDescription 29 | App获取WiFi名称需要打开您的设备的定位权限 30 | UIApplicationSceneManifest 31 | 32 | UIApplicationSupportsMultipleScenes 33 | 34 | UISceneConfigurations 35 | 36 | UIWindowSceneSessionRoleApplication 37 | 38 | 39 | UISceneConfigurationName 40 | Default Configuration 41 | UISceneDelegateClassName 42 | SceneDelegate 43 | UISceneStoryboardFile 44 | Main 45 | 46 | 47 | 48 | 49 | UILaunchStoryboardName 50 | LaunchScreen 51 | UIMainStoryboardFile 52 | Main 53 | UIRequiredDeviceCapabilities 54 | 55 | armv7 56 | 57 | UISupportedInterfaceOrientations 58 | 59 | UIInterfaceOrientationPortrait 60 | UIInterfaceOrientationLandscapeLeft 61 | UIInterfaceOrientationLandscapeRight 62 | 63 | UISupportedInterfaceOrientations~ipad 64 | 65 | UIInterfaceOrientationPortrait 66 | UIInterfaceOrientationPortraitUpsideDown 67 | UIInterfaceOrientationLandscapeLeft 68 | UIInterfaceOrientationLandscapeRight 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /kajslkd/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/4. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | #import 13 | #import 14 | #import 15 | 16 | #import "HLMacros.h" 17 | #import "UIColor+Extension.h" 18 | #import "UIView+Extension.h" 19 | #import "UIViewController+Extension.h" 20 | #import "CALayer+Extension.h" 21 | 22 | #import "HLDetailTableViewCell.h" 23 | #import "HLBaseTableViewCell.h" 24 | #import "HLBaseNavViewController.h" 25 | #import "HLBaseViewController.h" 26 | // Include any system framework and library headers here that should be included in all compilation units. 27 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 28 | #import 29 | #import 30 | #import 31 | 32 | #endif /* PrefixHeader_pch */ 33 | -------------------------------------------------------------------------------- /kajslkd/SceneDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.h 3 | // kajslkd 4 | // 5 | // Created by HanLiu on 2019/11/24. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SceneDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow * window; 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /kajslkd/SceneDelegate.m: -------------------------------------------------------------------------------- 1 | #import "SceneDelegate.h" 2 | 3 | @interface SceneDelegate () 4 | 5 | @end 6 | 7 | @implementation SceneDelegate 8 | 9 | 10 | - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { 11 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 12 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 13 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 14 | } 15 | 16 | 17 | - (void)sceneDidDisconnect:(UIScene *)scene { 18 | // Called as the scene is being released by the system. 19 | // This occurs shortly after the scene enters the background, or when its session is discarded. 20 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 21 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 22 | } 23 | 24 | 25 | - (void)sceneDidBecomeActive:(UIScene *)scene { 26 | // Called when the scene has moved from an inactive state to an active state. 27 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 28 | } 29 | 30 | 31 | - (void)sceneWillResignActive:(UIScene *)scene { 32 | // Called when the scene will move from an active state to an inactive state. 33 | // This may occur due to temporary interruptions (ex. an incoming phone call). 34 | } 35 | 36 | 37 | - (void)sceneWillEnterForeground:(UIScene *)scene { 38 | // Called as the scene transitions from the background to the foreground. 39 | // Use this method to undo the changes made on entering the background. 40 | } 41 | 42 | 43 | - (void)sceneDidEnterBackground:(UIScene *)scene { 44 | // Called as the scene transitions from the foreground to the background. 45 | // Use this method to save data, release shared resources, and store enough scene-specific state information 46 | // to restore the scene back to its current state. 47 | } 48 | 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /kajslkd/Vendor/HLFeedBack/HLFeedback.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLFeedback.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HLFeedback : NSObject 12 | 13 | + (instancetype)sharedInstance; 14 | 15 | - (void)sendFeedback; 16 | - (void)sendRate; 17 | - (void)rateInAppStore; 18 | - (void)alertWithMessage:(NSString *)msg; 19 | @end 20 | -------------------------------------------------------------------------------- /kajslkd/Vendor/HLFeedBack/HLFeedback.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLFeedback.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/11/11. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLFeedback.h" 10 | #import 11 | #import 12 | 13 | 14 | 15 | @interface HLFeedback() 16 | 17 | @end 18 | @implementation HLFeedback 19 | + (instancetype)sharedInstance { 20 | static HLFeedback *feedback = nil; 21 | static dispatch_once_t onceToken; 22 | dispatch_once(&onceToken, ^{ 23 | feedback = [[HLFeedback alloc] init]; 24 | }); 25 | return feedback; 26 | } 27 | 28 | - (void)sendFeedback 29 | { 30 | Class mailClass = (NSClassFromString(@"MFMailComposeViewController")); 31 | if (!mailClass) { 32 | [self alertWithMessage:@"当前系统版本不支持应用内发送邮件功能,您可以使用mailto方法代替"]; 33 | return; 34 | } 35 | if (![mailClass canSendMail]) { 36 | [self alertWithMessage:@"用户没有设置邮件账户"]; 37 | return; 38 | } 39 | [self displayMailPicker]; 40 | } 41 | 42 | - (void)sendRate { 43 | 44 | UIAlertController * alertVC = [UIAlertController alertControllerWithTitle:@"喜欢这个App吗?给个五星好评吧!" message:nil preferredStyle:UIAlertControllerStyleAlert]; 45 | //跳转APPStore 中应用的撰写评价页面 46 | UIAlertAction *review = [UIAlertAction actionWithTitle:@"我要吐槽" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 47 | [self rateInAppStore]; 48 | }]; 49 | //不做任何操作 50 | UIAlertAction *noReview = [UIAlertAction actionWithTitle:@"用用再说" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 51 | [alertVC removeFromParentViewController]; 52 | }]; 53 | 54 | [alertVC addAction:review]; 55 | [alertVC addAction:noReview]; 56 | 57 | 58 | if (@available(iOS 10.3, *)) {//判断系统,是否添加五星好评的入口 59 | if([SKStoreReviewController respondsToSelector:@selector(requestReview)]){ 60 | UIAlertAction *fiveStar = [UIAlertAction actionWithTitle:@"五星好评" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 61 | [[UIApplication sharedApplication].keyWindow endEditing:YES]; 62 | [SKStoreReviewController requestReview]; 63 | }]; 64 | [alertVC addAction:fiveStar]; 65 | } 66 | } 67 | 68 | dispatch_async(dispatch_get_main_queue(), ^{ 69 | [[UIViewController topViewController] presentViewController:alertVC animated:YES completion:nil]; 70 | }); 71 | 72 | } 73 | 74 | - (void)rateInAppStore { 75 | //应用内打开App store 页面,可以撰写评论。 76 | NSURL *appReviewUrl = [NSURL URLWithString:[NSString stringWithFormat: @"itms-apps://itunes.apple.com/app/id%@?action=write-review",KAPPID]];//换成你应用的 APPID 77 | //CGFloat version = [[[UIDevice currentDevice]systemVersion]floatValue]; 78 | /// 大于等于10.0系统使用此openURL方法 79 | if (@available (iOS 10.3,*)) { 80 | [[UIApplication sharedApplication] openURL:appReviewUrl options:@{} completionHandler:nil]; 81 | }else { 82 | [[UIApplication sharedApplication] openURL:appReviewUrl]; 83 | } 84 | 85 | } 86 | //代理方法 87 | #pragma mark - SKStoreProductViewControllerDelegate 88 | - (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController { 89 | [[UIViewController topViewController] dismissViewControllerAnimated:YES completion:^{ 90 | //[self alertWithMessage:@"Thanks for your comment!"]; 91 | }]; 92 | } 93 | - (void)alertWithMessage:(NSString *)msg { 94 | UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"" message:msg preferredStyle:UIAlertControllerStyleAlert]; 95 | [alertVC addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]]; 96 | [[UIViewController topViewController] presentViewController:alertVC animated:YES completion:nil]; 97 | } 98 | 99 | 100 | #pragma mark - 发邮件 101 | //调出邮件发送窗口 102 | - (void)displayMailPicker 103 | { 104 | MFMailComposeViewController *mailPicker = [[MFMailComposeViewController alloc] init]; 105 | mailPicker.mailComposeDelegate = self; 106 | 107 | //设置主题 108 | [mailPicker setSubject: [NSString stringWithFormat:@"[iSystant Lite]%@",HLLocalized(@"feedback")]]; 109 | //添加收件人 110 | NSArray *toRecipients = [NSArray arrayWithObject: @"weakstrongself@gmail.com"]; 111 | [mailPicker setToRecipients: toRecipients]; 112 | //添加抄送 113 | NSArray *ccRecipients = [NSArray arrayWithObjects:@"", nil]; 114 | [mailPicker setCcRecipients:ccRecipients]; 115 | //添加密送 116 | NSArray *bccRecipients = [NSArray arrayWithObjects:@"", nil]; 117 | [mailPicker setBccRecipients:bccRecipients]; 118 | 119 | // 添加一张图片 120 | // UIImage *addPic = [UIImage imageNamed: @"Icon@2x.png"]; 121 | // NSData *imageData = UIImagePNGRepresentation(addPic); // png 122 | // //关于mimeType:http://www.iana.org/assignments/media-types/index.html 123 | // [mailPicker addAttachmentData: imageData mimeType: @"" fileName: @"Icon.png"]; 124 | 125 | //添加一个pdf附件 126 | // NSString *file = [self fullBundlePathFromRelativePath:@"高质量C++编程指南.pdf"]; 127 | // NSData *pdf = [NSData dataWithContentsOfFile:file]; 128 | // [mailPicker addAttachmentData: pdf mimeType: @"" fileName: @"高质量C++编程指南.pdf"]; 129 | 130 | 131 | NSString *emailBodyWithdeviceInfo = [NSString stringWithFormat:@"%@



%@:%@
%@:%@
",HLLocalized(@"feedbackBodyTitle"),HLLocalized(@"OS Version"),[UIDevice currentDevice].systemVersion,HLLocalized(@"AppVersion"),[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]]; 132 | 133 | [mailPicker setMessageBody:emailBodyWithdeviceInfo isHTML:YES]; 134 | [[UIViewController topViewController] presentViewController:mailPicker animated:YES completion:nil]; 135 | } 136 | - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(nullable NSError *)error{ 137 | //关闭邮件发送窗口 138 | [[UIViewController topViewController] dismissViewControllerAnimated:YES completion:nil]; 139 | // NSString *msg; 140 | // switch (result) { 141 | // case MFMailComposeResultCancelled: 142 | // msg = @"用户取消编辑邮件"; 143 | // break; 144 | // case MFMailComposeResultSaved: 145 | // msg = @"用户成功保存邮件"; 146 | // break; 147 | // case MFMailComposeResultSent: 148 | // msg = @"用户点击发送,将邮件放到队列中,还没发送"; 149 | // break; 150 | // case MFMailComposeResultFailed: 151 | // msg = @"用户试图保存或者发送邮件失败"; 152 | // break; 153 | // default: 154 | // msg = @""; 155 | // break; 156 | // } 157 | // [self alertWithMessage:msg]; 158 | } 159 | 160 | @end 161 | -------------------------------------------------------------------------------- /kajslkd/Vendor/HLLabel/HLLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLLabel.h 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/12/6. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HLLabel : UILabel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /kajslkd/Vendor/HLLabel/HLLabel.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLLabel.m 3 | // SystemMonitor 4 | // 5 | // Created by HanLiu on 2018/12/6. 6 | // Copyright © 2018 HanLiu. All rights reserved. 7 | // 8 | 9 | #import "HLLabel.h" 10 | 11 | @implementation HLLabel 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame { 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | [self setUp]; 17 | } 18 | return self; 19 | } 20 | 21 | - (instancetype)init { 22 | self = [super init]; 23 | if (self) { 24 | [self setUp]; 25 | } 26 | return self; 27 | } 28 | - (void)awakeFromNib { 29 | [super awakeFromNib]; 30 | [self setUp]; 31 | } 32 | 33 | - (void)setUp { 34 | /* 你可以在这里添加一些代码,比如字体、居中、夜间模式等 */ 35 | self.userInteractionEnabled = YES; 36 | [self addGestureRecognizer:[[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longPress)]]; 37 | } 38 | 39 | - (void)longPress { 40 | 41 | // 设置label为第一响应者 42 | [self becomeFirstResponder]; 43 | 44 | // 自定义 UIMenuController 45 | UIMenuController * menu = [UIMenuController sharedMenuController]; 46 | UIMenuItem * item1 = [[UIMenuItem alloc]initWithTitle:@"复制" action:@selector(copyText:)]; 47 | menu.menuItems = @[item1]; 48 | [menu setTargetRect:self.bounds inView:self]; 49 | [menu setMenuVisible:YES animated:YES]; 50 | } 51 | 52 | - (void)copyText:(UIMenuController *)menu { 53 | // 没有文字时结束方法 54 | if (!self.text) return; 55 | // 复制文字到剪切板 56 | UIPasteboard * paste = [UIPasteboard generalPasteboard]; 57 | paste.string = self.text; 58 | 59 | } 60 | 61 | - (BOOL)canPerformAction:(SEL)action withSender:(id)sender { 62 | if(action == @selector(copyText:)) return YES; 63 | return NO; 64 | } 65 | - (BOOL)canBecomeFirstResponder { 66 | return YES; 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /kajslkd/Vendor/HLProgressView.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLProgressView.h 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/9. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLProgressView : UIProgressView 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /kajslkd/Vendor/HLProgressView.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLProgressView.m 3 | // iSystant Lite 4 | // 5 | // Created by HanLiu on 2019/11/9. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "HLProgressView.h" 10 | 11 | @implementation HLProgressView 12 | 13 | - (void)setProgress:(float)progress { 14 | super.progress = progress; 15 | if (progress < 1.0 && progress > 0.75) { 16 | //红色 17 | self.progressTintColor = [UIColor colorWithHex:@"FF4757"]; 18 | 19 | }else if (progress <= 0.75 && progress > 0.5) { 20 | //橙色 21 | self.progressTintColor = [UIColor colorWithHex:@"0xFFA502"]; 22 | 23 | }else if (progress <= 0.5 && progress > 0.25) { 24 | //淡绿 25 | self.progressTintColor = [UIColor colorWithHex:@"9fdfcd"]; 26 | }else { 27 | //绿色 28 | self.progressTintColor = [UIColor colorWithHex:@"0x2ED573"]; 29 | } 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /kajslkd/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | kajslkd 4 | 5 | Created by HanLiu on 2019/11/26. 6 | Copyright © 2019 iSystant. All rights reserved. 7 | */ 8 | 9 | "AppName" = "iSystant Pro-System Monitor"; 10 | 11 | "welcome" = "Hi"; 12 | 13 | "cores" = "cores"; 14 | "day" = "days"; 15 | "hour" = "hours"; 16 | "min" = "mins"; 17 | 18 | "Compass" = "Compass"; 19 | "Protractor" = "Protractor"; 20 | "Decibel" = "Decibel Meter"; 21 | "Speed Test" = "Speed Test"; 22 | "Level" = "Level"; 23 | "Suspension" = "Suspension correction"; 24 | "Rule" = "Rule"; 25 | "Shortcuts" = "Shortcuts"; 26 | 27 | "FreeMemory" = "Free"; 28 | "InactiveMemory" = "Inactive"; 29 | "ActiveMemory" = "Active"; 30 | "WiredMemory" = "Wired"; 31 | "AppUsedMemory" = "App Used"; 32 | "TotalMemory" = "Total"; 33 | "OtherMemory" = "Other"; 34 | 35 | "noWIFIConnection" = "No WiFi"; 36 | 37 | "feedback" = "Feedback"; 38 | "feedbackBodyTitle" = "My Issue:"; 39 | "feedbackSystemVersion" = "System version"; 40 | "AppVersion" = "App version"; 41 | 42 | "Privacy" = "Privacy"; 43 | "Agree" = "Agree"; 44 | "Disagree" = "Disagree"; 45 | "PrivacyContent" = "This application will not collect any user's personal information, please feel free to use. \nTn addition, the application will not disclose or provide the obtained device information to any third party without your prior permission. \nThis application will update this privacy policy from time to time. When you agree to use this application service agreement, you are deemed to have agreed to all contents of this privacy policy. \nThis privacy policy is an integral part of this application service usage agreement."; 46 | 47 | "latitude" = "latitude"; 48 | "longitude" = "longitude"; 49 | "East" = "East"; 50 | "West" = "West"; 51 | "South"= "South"; 52 | "North" = "North"; 53 | 54 | "OpenCamera" = "Open Camera"; 55 | "Long" = "Distance"; 56 | "Back" = "Back"; 57 | "startTest" = "Start Test"; 58 | "Continue" = "Continue"; 59 | "Warmly Attention" = "Warmly Attention"; 60 | "NetTestContent" = "The current mobile network, speed measurement may consume more traffic, whether to continue speed measurement"; 61 | "Netwaiting" = "Network is being detected, please wait"; 62 | 63 | 64 | "Loading" = "Sending Request.."; 65 | "Transacting" ="Transacting,Pleace don't leave..."; 66 | "Transaction Fail" = "Well it's a pity..."; 67 | "Verifing" = "Prepare verification..."; 68 | "Verify fail" = "Verification fail"; 69 | "Transaction Cancel" = "Well it's a pity..."; 70 | 71 | "Transcation Error" = "Oops,Something error!"; 72 | "Transcation Success" = "Success,Thanks for your big support!"; 73 | 74 | "Unknow" = "Unknow"; 75 | 76 | "Camera Locked" = "CAM LOCKED"; 77 | "Retake" = "RETAKE"; 78 | 79 | "MaxNoiseValue" = "Max"; 80 | "AveNoiseValue" = "Ave"; 81 | 82 | "Save" = "Save"; 83 | "Rest Battery" = "Rest Batt."; 84 | "Set Battery Heath" = "Set Battery Heath"; 85 | "Set Battery Heath Context" = "Battery Heath can be found in Setting->Battery->Battery Heath\nJust fill number like 90"; 86 | -------------------------------------------------------------------------------- /kajslkd/en.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UILabel"; text = "100%"; ObjectID = "2oU-FN-w2y"; */ 3 | "2oU-FN-w2y.text" = "100%"; 4 | 5 | /* Class = "UILabel"; text = "@Levihan"; ObjectID = "4ZM-Ue-KBQ"; */ 6 | "4ZM-Ue-KBQ.text" = "@Levihan"; 7 | 8 | /* Class = "UILabel"; text = "📌 Weibo"; ObjectID = "DaI-NH-Umb"; */ 9 | "DaI-NH-Umb.text" = "📌 Weibo"; 10 | 11 | /* Class = "UILabel"; text = "🌗Night Mode"; ObjectID = "G2E-uX-Xls"; */ 12 | "G2E-uX-Xls.text" = "🌗Night Mode"; 13 | 14 | /* Class = "UILabel"; text = "🔋Set Battery Heathy"; ObjectID = "LzO-tR-KSS"; */ 15 | "LzO-tR-KSS.text" = "🔋Set Battery Heathy"; 16 | 17 | /* Class = "UILabel"; text = "💡 Privacy"; ObjectID = "Qg1-d8-cVD"; */ 18 | "Qg1-d8-cVD.text" = "💡 Privacy"; 19 | 20 | /* Class = "UIBarButtonItem"; title = " "; ObjectID = "aC6-T5-ORs"; */ 21 | "aC6-T5-ORs.title" = " "; 22 | 23 | /* Class = "UILabel"; text = "1.0.0"; ObjectID = "c2i-sV-fR1"; */ 24 | "c2i-sV-fR1.text" = "1.0.0"; 25 | 26 | /* Class = "UITableViewSection"; headerTitle = "关于"; ObjectID = "fos-tD-5xN"; */ 27 | "fos-tD-5xN.headerTitle" = "About Us"; 28 | 29 | /* Class = "UILabel"; text = "✨ Rate US"; ObjectID = "hZY-b1-aYE"; */ 30 | "hZY-b1-aYE.text" = "✨ Rate Us"; 31 | 32 | /* Class = "UILabel"; text = "📮 Feedback"; ObjectID = "l0y-hZ-7Na"; */ 33 | "l0y-hZ-7Na.text" = "📮 Feedback"; 34 | 35 | /* Class = "UILabel"; text = "@寒先生的江雪"; ObjectID = "len-zf-6cY"; */ 36 | "len-zf-6cY.text" = "@寒先生的江雪"; 37 | 38 | /* Class = "UITextView"; text = "隐私政策:\n\n本应用不会收集任何用户个人信息,请放心使用。\n\n另外在未征得您事先许可的情况下,本应用不会将获取到的设备信息对外披露或向第三方提供。\n\n本应用会不时更新本隐私权政策。 您在同意本应用服务使用协议之时,即视为您已经同意本隐私权政策全部内容。\n\n本隐私权政策属于本应用服务使用协议不可分割的一部分。"; ObjectID = "m4y-Ve-JNK"; */ 39 | "m4y-Ve-JNK.text" = "This application will not collect any user's personal information, please feel free to use. \nIn addition, the application will not disclose or provide the obtained device information to any third party without your prior permission. \nThis application will update this privacy policy from time to time. When you agree to use this application service agreement, you are deemed to have agreed to all contents of this privacy policy. \nThis privacy policy is an integral part of this application service usage agreement."; 40 | 41 | /* Class = "UILabel"; text = "🍒 Share With US"; ObjectID = "mN8-Xv-YSz"; */ 42 | "mN8-Xv-YSz.text" = "🍒 Share With Us"; 43 | 44 | /* Class = "UITableViewSection"; headerTitle = "功能"; ObjectID = "mwj-Hb-QKv"; */ 45 | "mwj-Hb-QKv.headerTitle" = "Feature"; 46 | 47 | /* Class = "UITableViewSection"; headerTitle = "Indie Developer - Levi with❤️"; ObjectID = "oCz-nu-yTo"; */ 48 | "oCz-nu-yTo.headerTitle" = "Indie Developer - Levi with❤️"; 49 | 50 | /* Class = "UITableViewSection"; headerTitle = "开发者"; ObjectID = "peO-HK-BTY"; */ 51 | "peO-HK-BTY.headerTitle" = "Contact"; 52 | 53 | /* Class = "UILabel"; text = "🍎 App Version"; ObjectID = "qUB-wA-bb4"; */ 54 | "qUB-wA-bb4.text" = "🍎 App Version"; 55 | 56 | /* Class = "UINavigationItem"; title = "设置"; ObjectID = "qxE-Tc-DSq"; */ 57 | "qxE-Tc-DSq.title" = "Setting"; 58 | 59 | /* Class = "UILabel"; text = "🐦 Twitter"; ObjectID = "v1V-bm-w4C"; */ 60 | "v1V-bm-w4C.text" = "🐦 Twitter"; 61 | -------------------------------------------------------------------------------- /kajslkd/iSystant Lite.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.networking.wifi-info 6 | 7 | com.apple.security.application-groups 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /kajslkd/iSystant LiteDebug.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.networking.wifi-info 6 | 7 | com.apple.security.application-groups 8 | 9 | group.com.hl1987.app.isystant-lite 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /kajslkd/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // kajslkd 4 | // 5 | // Created by HanLiu on 2019/11/24. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | NSString * appDelegateClassName; 14 | @autoreleasepool { 15 | // Setup code that might create autoreleased objects goes here. 16 | appDelegateClassName = NSStringFromClass([AppDelegate class]); 17 | } 18 | return UIApplicationMain(argc, argv, nil, appDelegateClassName); 19 | } 20 | -------------------------------------------------------------------------------- /kajslkd/theme.txt: -------------------------------------------------------------------------------- 1 | NORMAL NIGHT 2 | #ffffff #343434 BG 3 | #aaaaaa #313131 SEP 4 | #0000ff #ffffff TINT 5 | #000000 #ffffff TEXT 6 | #ffffff #444444 BAR 7 | #f0f0f0 #222222 HIGHLIGHTED -------------------------------------------------------------------------------- /kajslkd/zh-Hans.lproj/LaunchScreen.strings: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kajslkd/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | kajslkd 4 | 5 | Created by HanLiu on 2019/11/26. 6 | Copyright © 2019 iSystant. All rights reserved. 7 | */ 8 | "AppName" = "iSystant Pro-CPU内存网络流量监测"; 9 | "Welcome" = "你好"; 10 | 11 | "core" = "核"; 12 | "day" = "天"; 13 | "hour" = "小时"; 14 | "min" = "分钟"; 15 | "Compass" = "指南针"; 16 | "Protractor" = "量角器"; 17 | "Decibel" = "分贝仪"; 18 | "Speed Test" = "网速测试"; 19 | "Level" = "水平仪"; 20 | "Suspension" = "悬挂物矫正"; 21 | "Rule" = "尺子"; 22 | "Shortcuts" = "捷径社区"; 23 | 24 | 25 | "China Unicom" = "中国联通"; 26 | "China Mobile" = "中国移动"; 27 | "China Telecom" = "中国电信"; 28 | "No Carrier" = "无运营商"; 29 | 30 | "noWIFIConnection" = "未连接到WIFI"; 31 | 32 | "feedback" = "用户反馈"; 33 | "feedbackBodyTitle" = "我的反馈"; 34 | "AppVersion" = "App版本"; 35 | 36 | "Privacy" = "隐私政策"; 37 | "Agree" = "同意"; 38 | "Disagree" = "不同意"; 39 | "PrivacyContent" = "本应用不会收集任何用户个人信息,请放心使用。\n另外在未征得您事先许可的情况下,本应用不会将获取到的设备信息对外披露或向第三方提供。本应用会不时更新本隐私权政策。\n 您在同意本应用服务使用协议之时,即视为您已经同意本隐私权政策全部内容。\n本隐私权政策属于本应用服务使用协议不可分割的一部分。"; 40 | 41 | 42 | "latitude" = "纬度"; 43 | "longitude" = "经度"; 44 | "East" = "东"; 45 | "West" = "西"; 46 | "South"= "南"; 47 | "North" = "北"; 48 | "OpenCamera" = "打开相机"; 49 | "Long" = "长度"; 50 | "Back" = "返回"; 51 | "startTest" = "开始测速"; 52 | "Continue" = "继续"; 53 | "Warmly Attention" = "温馨提示"; 54 | "NetTestContent" = "当前是移动网络,测速可能会消耗较多流量,是否继续测速"; 55 | "Netwaiting" = "正在检测网络,请稍后"; 56 | "noiseSize" = "当前噪音/单位"; 57 | "CPU Usage" = "CPU使用率"; 58 | "App CPU Usage" = "应用CPU使用率"; 59 | 60 | "Loading" = "正在请求..."; 61 | "Transacting" ="正在交易,请不要退出应用..."; 62 | "Transaction Fail" = "好可惜,交易失败了..."; 63 | "Verifing" = "准备验证..."; 64 | "Verify fail" = "验证失败"; 65 | "Transaction Cancel" = "好可惜,取消了..."; 66 | 67 | "Transcation Error" = "不可用,交易终止";//"Oops,Something error" 68 | "Transcation Success" = "交易成功,感谢您的支持和厚爱"; 69 | 70 | "Unknow" = "未知"; 71 | 72 | "Camera Locked" = "拍照锁定"; 73 | "Retake" = "重拍"; 74 | "MaxNoiseValue" = "最大值"; 75 | "AveNoiseValue" = "平均值"; 76 | "Save" = "保存"; 77 | "Default" = "默认"; 78 | "Widget Style" = "通知栏Widget样式"; 79 | "Real Remain" = "剩余电量"; 80 | "RAM:Used" = "内存:已用"; 81 | "Disk:Used" = "存储:已用"; 82 | "CPU Freq" = "CPU频率"; 83 | 84 | "Cancel" = "取消"; 85 | "Confirm" = "确定"; 86 | "Set Battery Heath" = "设置电池健康度"; 87 | "Set Battery Heath Context" = "电池健康度可以从设置->电池->电池健康度查看\n只需填写数字,如90"; 88 | 89 | 90 | //===========首页==================// 91 | "Storage" = "存储"; 92 | "Memory" = "内存"; 93 | "Network" = "网络"; 94 | "Battery" = "电池"; 95 | "Device" = "设备"; 96 | 97 | //===========设备=============// 98 | "Device Name" = "设备名称"; 99 | "Device Type" = "设备类型"; 100 | "Device Model" = "型号"; 101 | "Device Name" = "设备名称"; 102 | "Build Version" = "构建版本"; 103 | "OS Version" = "系统版本"; 104 | "TimeZone" = "时区"; 105 | "Reboot Date" = "启动时间"; 106 | "SystemUpTime" = "连续运行时间"; 107 | "Pixels" = "屏幕像素"; 108 | "Height" = "屏幕高度"; 109 | "Width" = "屏幕宽度"; 110 | "PPI" = "像素密度"; 111 | "System Language" = "系统语言"; 112 | "System" = "基本信息"; 113 | "Screen" = "屏幕"; 114 | "Others" = "其它信息"; 115 | 116 | //=========cpu========// 117 | "Model" = "型号"; 118 | "Arch" = "架构"; 119 | "Cores" = "核心数"; 120 | "L1Cache" = "L1缓存"; 121 | "L2Cache" = "L2缓存"; 122 | "L3Cache" = "L3缓存"; 123 | "SoC" = "芯片组"; 124 | "GPU Model" = "GPU型号"; 125 | "GPU Cores" = "GPU核心"; 126 | "GPU Metal" = "GPU图形跑分"; 127 | "Clock Frequency" = "时钟频率"; 128 | "CPU Single Core" = "CPU单核跑分"; 129 | "CPU Multi Core" = "CPU多核跑分"; 130 | "Motion Processor" = "协处理器"; 131 | "CPU Basic Info" = "基本信息"; 132 | "BEENCHMARK" = "BEENCHMARK评测分数"; 133 | "Current Frequency" = "实时频率"; 134 | //========内存=========// 135 | "Memory Type" = "内存型号"; 136 | "Read/Write Freq" = "读写频率"; 137 | "Total Memory" = "系统总内存"; 138 | "Idle" = "空闲内存"; 139 | "Inactive" = "不活跃内存"; 140 | "Active" = "活跃内存"; 141 | "Wired" = "联动内存"; 142 | "App Used" = "App使用内存"; 143 | "Other Memory" = "其它内存"; 144 | "Memory Info" = "内存基本信息"; 145 | "Aval. Memory" = "可用内存"; 146 | "Used. Memory" = "已用内存"; 147 | 148 | 149 | //========网络=========// 150 | "Carrier Name" = "网络运营商"; 151 | "Network Type" = "网络类型"; 152 | "Public IP" = "IP地址"; 153 | "Internal IP" = "局域网IP地址"; 154 | "WIFI Name" = "WIFI名称"; 155 | "DNS" = "域名解析服务器"; 156 | "Uplink Cell Data" = "上行蜂窝数据"; 157 | "Downlink Cell Data" = "下行蜂窝数据"; 158 | "Uplink WIFI" = "WIFI上行数据"; 159 | "Downlink WIFI" = "WIFI下行数据"; 160 | "WIFI MAC Address" = "WIFI地址"; 161 | "Uplink Speed" = "上行速率"; 162 | "Downlink Speed" = "下行速率"; 163 | "Network Basic Info" = "基本信息"; 164 | "RealTime Net Speed" = "实时网速"; 165 | "Network Flow" = "数据流量"; 166 | 167 | //===========// 168 | "UnKnow" = "未知"; 169 | "Unplugged" = "未充电"; 170 | "Charging" = "充电中"; 171 | "Full" = "已充满"; 172 | -------------------------------------------------------------------------------- /kajslkd/zh-Hans.lproj/Main.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UILabel"; text = "100%"; ObjectID = "2oU-FN-w2y"; */ 3 | "2oU-FN-w2y.text" = "100%"; 4 | 5 | /* Class = "UILabel"; text = "@Levihan"; ObjectID = "4ZM-Ue-KBQ"; */ 6 | "4ZM-Ue-KBQ.text" = "@Levihan"; 7 | 8 | /* Class = "UILabel"; text = "📌 微博"; ObjectID = "DaI-NH-Umb"; */ 9 | "DaI-NH-Umb.text" = "📌 微博"; 10 | 11 | /* Class = "UILabel"; text = "🌗夜间模式"; ObjectID = "G2E-uX-Xls"; */ 12 | "G2E-uX-Xls.text" = "🌗夜间模式"; 13 | 14 | /* Class = "UILabel"; text = "🔋设置电池健康度"; ObjectID = "LzO-tR-KSS"; */ 15 | "LzO-tR-KSS.text" = "🔋设置电池健康度"; 16 | 17 | /* Class = "UILabel"; text = "💡 隐私条例"; ObjectID = "Qg1-d8-cVD"; */ 18 | "Qg1-d8-cVD.text" = "💡 隐私条例"; 19 | 20 | /* Class = "UIBarButtonItem"; title = " "; ObjectID = "aC6-T5-ORs"; */ 21 | "aC6-T5-ORs.title" = " "; 22 | 23 | /* Class = "UILabel"; text = "1.0.0"; ObjectID = "c2i-sV-fR1"; */ 24 | "c2i-sV-fR1.text" = "1.0.0"; 25 | 26 | /* Class = "UITableViewSection"; headerTitle = "关于"; ObjectID = "fos-tD-5xN"; */ 27 | "fos-tD-5xN.headerTitle" = "关于"; 28 | 29 | /* Class = "UILabel"; text = "✨ 点个赞呗"; ObjectID = "hZY-b1-aYE"; */ 30 | "hZY-b1-aYE.text" = "✨ 点个赞呗"; 31 | 32 | /* Class = "UILabel"; text = "📮 意见反馈"; ObjectID = "l0y-hZ-7Na"; */ 33 | "l0y-hZ-7Na.text" = "📮 意见反馈"; 34 | 35 | /* Class = "UILabel"; text = "@寒先生的江雪"; ObjectID = "len-zf-6cY"; */ 36 | "len-zf-6cY.text" = "@寒先生的江雪"; 37 | 38 | /* Class = "UITextView"; text = "隐私政策:\n\n本应用不会收集任何用户个人信息,请放心使用。\n\n另外在未征得您事先许可的情况下,本应用不会将获取到的设备信息对外披露或向第三方提供。\n\n本应用会不时更新本隐私权政策。 您在同意本应用服务使用协议之时,即视为您已经同意本隐私权政策全部内容。\n\n本隐私权政策属于本应用服务使用协议不可分割的一部分。"; ObjectID = "m4y-Ve-JNK"; */ 39 | "m4y-Ve-JNK.text" = "隐私政策:\n\n本应用不会收集任何用户个人信息,请放心使用。\n\n另外在未征得您事先许可的情况下,本应用不会将获取到的设备信息对外披露或向第三方提供。\n\n本应用会不时更新本隐私权政策。 您在同意本应用服务使用协议之时,即视为您已经同意本隐私权政策全部内容。\n\n本隐私权政策属于本应用服务使用协议不可分割的一部分。"; 40 | 41 | /* Class = "UILabel"; text = "🍒 分享最美"; ObjectID = "mN8-Xv-YSz"; */ 42 | "mN8-Xv-YSz.text" = "🍒 分享最美"; 43 | 44 | /* Class = "UITableViewSection"; headerTitle = "功能"; ObjectID = "mwj-Hb-QKv"; */ 45 | "mwj-Hb-QKv.headerTitle" = "功能"; 46 | 47 | /* Class = "UITableViewSection"; headerTitle = "独立开发者Levi作品with❤️"; ObjectID = "oCz-nu-yTo"; */ 48 | "oCz-nu-yTo.headerTitle" = "独立开发者Levi作品with❤️"; 49 | 50 | /* Class = "UITableViewSection"; headerTitle = "开发者"; ObjectID = "peO-HK-BTY"; */ 51 | "peO-HK-BTY.headerTitle" = "开发者"; 52 | 53 | /* Class = "UILabel"; text = "🍎 应用版本"; ObjectID = "qUB-wA-bb4"; */ 54 | "qUB-wA-bb4.text" = "🍎 应用版本"; 55 | 56 | /* Class = "UINavigationItem"; title = "设置"; ObjectID = "qxE-Tc-DSq"; */ 57 | "qxE-Tc-DSq.title" = "设置"; 58 | 59 | /* Class = "UILabel"; text = "🐦 Twitter"; ObjectID = "v1V-bm-w4C"; */ 60 | "v1V-bm-w4C.text" = "🐦 Twitter"; 61 | -------------------------------------------------------------------------------- /resource/0x0ss-P3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/resource/0x0ss-P3.jpg -------------------------------------------------------------------------------- /resource/0x0ss-P3_dark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/koalahl/iSystant/98fe8b85a84bd9d3447c59fe5bdb82add8725897/resource/0x0ss-P3_dark.jpg -------------------------------------------------------------------------------- /sysmonitorTodayExt/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | $(PRODUCT_NAME) 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSExtension 24 | 25 | NSExtensionMainStoryboard 26 | MainInterface 27 | NSExtensionPointIdentifier 28 | com.apple.widget-extension 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /sysmonitorTodayExt/TodayViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TodayViewController.h 3 | // sysmonitorTodayExt 4 | // 5 | // Created by HanLiu on 2019/12/4. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TodayViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /sysmonitorTodayExt/TodayViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TodayViewController.m 3 | // sysmonitorTodayExt 4 | // 5 | // Created by HanLiu on 2019/12/4. 6 | // Copyright © 2019 iSystant. All rights reserved. 7 | // 8 | 9 | #import "TodayViewController.h" 10 | #import 11 | #import 12 | 13 | @interface TodayViewController () 14 | 15 | @property (weak, nonatomic) IBOutlet UILabel *freeRAMLabel; 16 | @property (weak, nonatomic) IBOutlet UILabel *usedRAMLabel; 17 | @property (weak, nonatomic) IBOutlet UILabel *upNetSpeedLabel; 18 | @property (weak, nonatomic) IBOutlet UILabel *downNetSpeedLabel; 19 | @property (weak, nonatomic) IBOutlet UILabel *freeDiskLabel; 20 | @property (weak, nonatomic) IBOutlet UILabel *UsedDiskLabel; 21 | 22 | @property (nonatomic, strong) NSTimer *timerForMemory; 23 | @property (nonatomic, strong) NSTimer *timerForSpeed; 24 | @end 25 | 26 | @implementation TodayViewController 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | [[UIDevice currentDevice] setBatteryMonitoringEnabled:YES]; 31 | [[HLSystemMonitor sharedMonitor] parseDeviceFile]; 32 | [HLSystemMonitor startMonitorNetworkFlowWith:[HLSystemMonitor sharedMonitor].netowrkRefreshInterval]; 33 | [HLSystemMonitor startMemoryMonitor:[HLSystemMonitor sharedMonitor].memoryRefreshInterval]; 34 | 35 | // NSUserDefaults *group = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.hl1987.app.isystant-lite"]; 36 | } 37 | 38 | - (void)viewWillAppear:(BOOL)animated { 39 | [super viewWillAppear:animated]; 40 | _timerForSpeed = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(refreshNetworkSpeed) userInfo:nil repeats:YES]; 41 | [[NSRunLoop currentRunLoop] addTimer:_timerForSpeed forMode:NSRunLoopCommonModes]; 42 | [_timerForSpeed fire]; 43 | 44 | _timerForMemory = [NSTimer scheduledTimerWithTimeInterval:1.67 target:self selector:@selector(refresh) userInfo:nil repeats:YES]; 45 | [[NSRunLoop currentRunLoop] addTimer:_timerForMemory forMode:NSRunLoopCommonModes]; 46 | [_timerForMemory fire]; 47 | 48 | [self configDiskInfo]; 49 | } 50 | 51 | - (void)viewDidDisappear:(BOOL)animated { 52 | [_timerForSpeed invalidate]; 53 | _timerForSpeed = nil; 54 | [_timerForMemory invalidate]; 55 | _timerForMemory = nil; 56 | [HLSystemMonitor stopMonitor]; 57 | } 58 | 59 | - (void)refresh { 60 | [self configMemory]; 61 | } 62 | 63 | - (void)refreshNetworkSpeed { 64 | 65 | NSString *downloadSpeed = [HLNetworkMonitor network].downloadNetworkSpeed; 66 | NSString *uploadSpeed = [HLNetworkMonitor network].uploadNetworkSpeed; 67 | //通知主线程刷新 68 | dispatch_async(dispatch_get_main_queue(), ^{ 69 | self.upNetSpeedLabel.text = uploadSpeed; 70 | self.downNetSpeedLabel.text = downloadSpeed; 71 | }); 72 | 73 | } 74 | 75 | - (void)configMemory { 76 | NSString *usedmemory = [HLMemoryMonitor monitor].totalUsedMemory ; 77 | NSString *freememory = [HLMemoryMonitor monitor].freeMemory ; 78 | 79 | dispatch_async(dispatch_get_main_queue(), ^{ 80 | self.freeRAMLabel.text = freememory; 81 | self.usedRAMLabel.text = usedmemory; 82 | }); 83 | } 84 | 85 | /// 磁盘存储信息 86 | - (void)configDiskInfo { 87 | NSDictionary *dic = [HLDeviceInformation getDeviceSize]; 88 | dispatch_async(dispatch_get_main_queue(), ^{ 89 | self.freeDiskLabel.text = dic[@"freeSpace"]; 90 | self.UsedDiskLabel.text = dic[@"usedSpace"]; 91 | }); 92 | 93 | } 94 | 95 | 96 | - (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler { 97 | // Perform any setup necessary in order to update the view. 98 | 99 | // If an error is encountered, use NCUpdateResultFailed 100 | // If there's no update required, use NCUpdateResultNoData 101 | // If there's an update, use NCUpdateResultNewData 102 | 103 | completionHandler(NCUpdateResultNewData); 104 | } 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /sysmonitorTodayExt/iSystant LiteDebug.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.networking.wifi-info 6 | 7 | com.apple.security.application-groups 8 | 9 | group.com.hl1987.app.isystant-lite 10 | 11 | 12 | 13 | --------------------------------------------------------------------------------