├── EasyRelease ├── EasyRelease │ ├── Custom │ │ ├── GitHubUpdates.framework │ │ │ ├── Versions │ │ │ │ ├── Current │ │ │ │ └── A │ │ │ │ │ ├── Relauncher │ │ │ │ │ ├── GitHubUpdates │ │ │ │ │ ├── Modules │ │ │ │ │ └── module.modulemap │ │ │ │ │ ├── Resources │ │ │ │ │ ├── GitHubTemplate.pdf │ │ │ │ │ ├── Base.lproj │ │ │ │ │ │ ├── GitHubInstallWindowController.nib │ │ │ │ │ │ └── GitHubProgressWindowController.nib │ │ │ │ │ └── Info.plist │ │ │ │ │ ├── Headers │ │ │ │ │ ├── GitHubUpdates.h │ │ │ │ │ ├── GitHubInstallWindowController.h │ │ │ │ │ ├── GitHubReleaseAsset.h │ │ │ │ │ ├── GitHubProgressWindowController.h │ │ │ │ │ ├── GitHubUpdater.h │ │ │ │ │ └── GitHubRelease.h │ │ │ │ │ └── PrivateHeaders │ │ │ │ │ ├── NSError+GitHubUpdates.h │ │ │ │ │ ├── NSString+GitHubUpdates.h │ │ │ │ │ ├── NSAttributedString+GitHubUpdates.h │ │ │ │ │ ├── NSBundle+GitHubUpdates.h │ │ │ │ │ ├── Pair.h │ │ │ │ │ └── NSMutableAttributedString+GitHubUpdates.h │ │ │ ├── Headers │ │ │ ├── Modules │ │ │ ├── Resources │ │ │ ├── GitHubUpdates │ │ │ └── PrivateHeaders │ │ ├── Relauncher │ │ ├── ArtProgressHUD │ │ │ └── ArtProgressHUD │ │ │ │ ├── ArtHUDView.h │ │ │ │ ├── Resources │ │ │ │ ├── MLHudAlertInfo.png │ │ │ │ ├── MLHudAlertWarn.png │ │ │ │ ├── MLHudAlertError.png │ │ │ │ └── MLHudAlertSuccess.png │ │ │ │ ├── ArtHUDView.m │ │ │ │ ├── ArtProgressHUD.h │ │ │ │ ├── ArtProgressHUD.xib │ │ │ │ └── ArtProgressHUD.m │ │ ├── Controls │ │ │ └── Button │ │ │ │ ├── NYSRoundImageButton.h │ │ │ │ ├── NYSFitSizeTextButton.h │ │ │ │ ├── NYSTextButton.h │ │ │ │ ├── NYSImageTextButton.h │ │ │ │ ├── NYSImageButton.h │ │ │ │ ├── NYSFitSizeTextButton.m │ │ │ │ ├── NYSRoundImageButton.m │ │ │ │ ├── NYSLabel.h │ │ │ │ ├── NYSTextButton.m │ │ │ │ ├── NYSImageTextButton.m │ │ │ │ ├── NYSImageButton.m │ │ │ │ └── NYSLabel.m │ │ ├── Categories │ │ │ ├── NSColor+RGBValue.h │ │ │ └── NSColor+RGBValue.m │ │ ├── YYModel │ │ │ ├── YYModel.h │ │ │ └── YYClassInfo.h │ │ ├── NYSUtils.h │ │ ├── NYSTool.swift │ │ └── NYSUtils.m │ ├── SupportingFiles │ │ ├── Assets.xcassets │ │ │ ├── Contents.json │ │ │ ├── Resources │ │ │ │ ├── Contents.json │ │ │ │ ├── logo.imageset │ │ │ │ │ ├── logo.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── terminal.imageset │ │ │ │ │ ├── terminal.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── icon_close.imageset │ │ │ │ │ ├── icon_close_s.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── icon_upload.imageset │ │ │ │ │ ├── icon_upload.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── icon_notice.imageset │ │ │ │ │ ├── icon_notice_s.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── icon_download.imageset │ │ │ │ │ ├── icon_download.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── icon_ignore.imageset │ │ │ │ │ ├── icon_ignore@2x.png │ │ │ │ │ ├── icon_ignore@3x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── icon_setting.imageset │ │ │ │ │ ├── icon_setting_s.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── icon_minimize.imageset │ │ │ │ │ ├── icon_minimize_s.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── icon_nav_normal_mix.imageset │ │ │ │ │ ├── icon_nav_normal_5.pdf │ │ │ │ │ └── Contents.json │ │ │ │ ├── user_photo_default.imageset │ │ │ │ │ ├── user_photo_default.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── icon_nav_normal_import.imageset │ │ │ │ │ ├── icon_nav_normal_6.pdf │ │ │ │ │ └── Contents.json │ │ │ │ ├── icon_nav_normal_action.imageset │ │ │ │ │ ├── icon_nav_normal_4@2x.png │ │ │ │ │ ├── icon_nav_normal_4@3x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── icon_nav_normal_modify.imageset │ │ │ │ │ ├── icon_nav_normal_3@2x.png │ │ │ │ │ ├── icon_nav_normal_3@3x.png │ │ │ │ │ └── Contents.json │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── icon-128.png │ │ │ │ ├── icon-16.png │ │ │ │ ├── icon-256.png │ │ │ │ ├── icon-32.png │ │ │ │ ├── icon-512.png │ │ │ │ ├── icon-16@2x.png │ │ │ │ ├── icon-32@2x.png │ │ │ │ ├── icon-128@2x.png │ │ │ │ ├── icon-256@2x.png │ │ │ │ ├── icon-512@2x.png │ │ │ │ └── Contents.json │ │ │ └── AccentColor.colorset │ │ │ │ └── Contents.json │ │ ├── EasyRelease.entitlements │ │ ├── EasyRelease-Bridging-Header.h │ │ ├── EasyRelease-Swift.h │ │ ├── main.m │ │ ├── Info.plist │ │ ├── NullSafe.m │ │ └── PrefixHeader.pch │ ├── View │ │ ├── MainWindow │ │ │ ├── MainWindow.h │ │ │ ├── MainWindowView.h │ │ │ ├── MainWindowController.h │ │ │ ├── NYSPanelWindow.h │ │ │ ├── AppDelegate.h │ │ │ ├── MainWindowView.m │ │ │ ├── MainWindowController.m │ │ │ ├── MainWindow.m │ │ │ ├── AppDelegate.m │ │ │ ├── NYSPanelWindow.m │ │ │ ├── MainWindow.xib │ │ │ └── NYSPanelWindow.xib │ │ ├── TitleBar │ │ │ ├── NYSNoticeView.h │ │ │ ├── NYSTitleBarView.h │ │ │ ├── NYSTitleBarVC.h │ │ │ ├── NYSNoticeVC.h │ │ │ ├── NYSTitleBarView.m │ │ │ ├── NYSNoticeView.m │ │ │ ├── NYSNoticeVC.m │ │ │ └── NYSTitleBarVC.m │ │ ├── Controller │ │ │ ├── NYSContentVC.h │ │ │ ├── NYSContentView.h │ │ │ ├── NYSShowTipViewControlle.h │ │ │ ├── NYSActionVC.h │ │ │ ├── NYSModificationVC.h │ │ │ ├── NYSProjectImportVC.h │ │ │ ├── NYSReplaceConfigVC.h │ │ │ ├── NYSShowTipViewControlle.m │ │ │ ├── NYSContentView.m │ │ │ ├── NYSShowTipViewControlle.xib │ │ │ ├── NYSContentVC.m │ │ │ ├── NYSModificationVC.m │ │ │ ├── NYSProjectImportVC.m │ │ │ └── NYSReplaceConfigVC.m │ │ └── Navigation │ │ │ ├── NYSNavigateView.h │ │ │ ├── NYSNavigateVC.h │ │ │ ├── NYSNavigateItem.h │ │ │ ├── NYSNavigateItemVC.h │ │ │ ├── NYSNavigateView.m │ │ │ ├── NYSNavigateItem.m │ │ │ ├── NYSNavigateVC.m │ │ │ └── NYSNavigateItemVC.m │ └── Model │ │ ├── rehash.sh │ │ ├── NYSAction.h │ │ ├── podInstall.sh │ │ ├── NYSConfigManager.h │ │ ├── NYSConfigManager.m │ │ ├── EasyRelease.json │ │ ├── NYSConfigModel.h │ │ ├── NYSConfigModel.m │ │ └── logo_str.erc └── EasyRelease.xcodeproj │ └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ ├── WorkspaceSettings.xcsettings │ └── IDEWorkspaceChecks.plist ├── logo.png ├── LICENSE ├── .gitignore └── README.md /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/logo.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/GitHubUpdates: -------------------------------------------------------------------------------- 1 | Versions/Current/GitHubUpdates -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/PrivateHeaders: -------------------------------------------------------------------------------- 1 | Versions/Current/PrivateHeaders -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Relauncher: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/Custom/Relauncher -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/ArtHUDView.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ArtHUDView : NSWindow 4 | @property (nonatomic, assign) CGFloat cornerRadius; 5 | @end 6 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Relauncher: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Relauncher -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/GitHubUpdates: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/GitHubUpdates -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module GitHubUpdates { 2 | umbrella header "GitHubUpdates.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-128.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-16.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-256.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-32.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-512.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/Resources/MLHudAlertInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/Resources/MLHudAlertInfo.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/Resources/MLHudAlertWarn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/Resources/MLHudAlertWarn.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-16@2x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-32@2x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/logo.imageset/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/logo.imageset/logo.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/Resources/MLHudAlertError.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/Resources/MLHudAlertError.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/Resources/MLHudAlertSuccess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/Resources/MLHudAlertSuccess.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-128@2x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-256@2x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/icon-512@2x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Resources/GitHubTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Resources/GitHubTemplate.pdf -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/terminal.imageset/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/terminal.imageset/terminal.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_close.imageset/icon_close_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_close.imageset/icon_close_s.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_upload.imageset/icon_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_upload.imageset/icon_upload.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_notice.imageset/icon_notice_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_notice.imageset/icon_notice_s.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/EasyRelease.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_download.imageset/icon_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_download.imageset/icon_download.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_ignore.imageset/icon_ignore@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_ignore.imageset/icon_ignore@2x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_ignore.imageset/icon_ignore@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_ignore.imageset/icon_ignore@3x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_setting.imageset/icon_setting_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_setting.imageset/icon_setting_s.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_minimize.imageset/icon_minimize_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_minimize.imageset/icon_minimize_s.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_mix.imageset/icon_nav_normal_5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_mix.imageset/icon_nav_normal_5.pdf -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/user_photo_default.imageset/user_photo_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/user_photo_default.imageset/user_photo_default.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_import.imageset/icon_nav_normal_6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_import.imageset/icon_nav_normal_6.pdf -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Resources/Base.lproj/GitHubInstallWindowController.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Resources/Base.lproj/GitHubInstallWindowController.nib -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Resources/Base.lproj/GitHubProgressWindowController.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Resources/Base.lproj/GitHubProgressWindowController.nib -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_action.imageset/icon_nav_normal_4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_action.imageset/icon_nav_normal_4@2x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_action.imageset/icon_nav_normal_4@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_action.imageset/icon_nav_normal_4@3x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_modify.imageset/icon_nav_normal_3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_modify.imageset/icon_nav_normal_3@2x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_modify.imageset/icon_nav_normal_3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/niyongsheng/EasyRelease/HEAD/EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_modify.imageset/icon_nav_normal_3@3x.png -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/MainWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindow.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainWindow : NSWindow 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/TitleBar/NYSNoticeView.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNoticeView.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSNoticeView : NSView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSContentVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSContentVC.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSContentVC : NSViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSContentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSContentView.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSContentView : NSView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/MainWindowView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowView.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainWindowView : NSView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Navigation/NYSNavigateView.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNavigateView.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSNavigateView : NSView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/TitleBar/NYSTitleBarView.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSTitleBarView.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSTitleBarView : NSView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Navigation/NYSNavigateVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNavigateVC.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSNavigateVC : NSViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/TitleBar/NYSTitleBarVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSTitleBarVC.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSTitleBarVC : NSViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/EasyRelease-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Bridging-Header.h 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/5. 6 | // 7 | 8 | #ifndef Bridging_Header_h 9 | #define Bridging_Header_h 10 | 11 | #import 12 | 13 | #endif /* Bridging_Header_h */ 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSRoundImageButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSRoundImageButton.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSRoundImageButton : NSButton 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/MainWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowController.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainWindowController : NSWindowController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/TitleBar/NYSNoticeVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNoticeVC.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NYSNoticeView.h" 11 | 12 | @interface NYSNoticeVC : NSViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/EasyRelease-Swift.h: -------------------------------------------------------------------------------- 1 | // 2 | // EasyRelease-Swift.h 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/6. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #ifndef EasyRelease_Swift_h 10 | #define EasyRelease_Swift_h 11 | 12 | //@import NYSTool; 13 | 14 | #endif /* EasyRelease_Swift_h */ 15 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSFitSizeTextButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSFitSizeTextButton.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NYSTextButton.h" 11 | 12 | @interface NYSFitSizeTextButton : NYSTextButton 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Navigation/NYSNavigateItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNavigateItem.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSNavigateItem : NSView 12 | 13 | @property (nonatomic, strong) NSColor *bkColor; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // easyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/4. 6 | // 7 | 8 | #import 9 | 10 | int main(int argc, const char * argv[]) { 11 | @autoreleasepool { 12 | // Setup code that might create autoreleased objects goes here. 13 | } 14 | return NSApplicationMain(argc, argv); 15 | } 16 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Model/rehash.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # author:niyongsheng 3 | # url:https://github.com/niyongsheng/EasyRelease 4 | # usage:sh rehash.sh /Users/niyongsheng/EasyRelease 5 | # if you installed `imagemagick` bug it not work, please run `which convert` replace `/usr/local/bin/convert`. 6 | cd $* && pwd && ls -al && find . -iname "*.png" -exec echo {} \; -exec /usr/local/bin/convert {} {} \; 7 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSShowTipViewControlle.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSShowTipViewControlle.h 3 | // EasyRelease 4 | // 5 | // Created by 倪刚 on 2021/2/24. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NYSShowTipViewControlle : NSViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/NYSPanelWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSPanelWindow.h 3 | // EasyRelease 4 | // 5 | // Created by niyongsheng on 2021/3/3. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NYSPanelWindow : NSWindow 14 | @property (nonatomic, strong) NSString *oldProjectName; 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSActionVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSActionVC.h 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/19. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NYSActionVC : NSViewController 14 | 15 | - (instancetype)initWithFrame:(NSRect)frameRect; 16 | 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSModificationVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSModificationVC.h 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/19. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NYSModificationVC : NSViewController 14 | 15 | - (instancetype)initWithFrame:(NSRect)frameRect; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSProjectImportVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSProjectImportVC.h 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/19. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NYSProjectImportVC : NSViewController 14 | 15 | - (instancetype)initWithFrame:(NSRect)frameRect; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // easyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/4. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | @property (nonatomic, strong) NSWindowController *mainWC; 14 | 15 | @property (nonatomic, strong) GitHubUpdater *updater; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSReplaceConfigVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSReplaceConfigVC.h 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/19. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NYSReplaceConfigVC : NSViewController 14 | 15 | - (instancetype)initWithFrame:(NSRect)frameRect; 16 | 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Model/NYSAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSAction.h 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/23. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NYSConfigModel.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface NYSAction : NSObject 15 | - (instancetype)initWithConfig:(NYSConfigModel *)config; 16 | - (void)action; 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "logo.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/terminal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "terminal.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_close.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_close_s.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_notice.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_notice_s.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_upload.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_upload.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSShowTipViewControlle.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSShowTipViewControlle.m 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/24. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import "NYSShowTipViewControlle.h" 10 | 11 | @interface NYSShowTipViewControlle () 12 | 13 | @end 14 | 15 | @implementation NYSShowTipViewControlle 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do view setup here. 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_download.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_download.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_minimize.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_minimize_s.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_setting.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_setting_s.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_import.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_nav_normal_6.pdf", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_mix.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_nav_normal_5.pdf", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/user_photo_default.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "user_photo_default.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_ignore.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "icon_ignore@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "icon_ignore@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSTextButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSTextButton.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSTextButton : NSButton 12 | 13 | @property (nonatomic) int fontSize; 14 | 15 | - (void)setTitle:(NSString *)title 16 | withNormalColor:(NSColor *)normal 17 | hoverColor:(NSColor *)hover; 18 | 19 | - (void)setMouseEntered; 20 | 21 | - (void)setMouseExited; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Model/podInstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # author:niyongsheng 3 | # url:https://github.com/niyongsheng/EasyRelease 4 | # usage:sh podInstall.sh /Users/niyongsheng/EasyRelease 5 | # if you installed `CocoaPod` bug it not work, please run `which pod` replace `/usr/local/bin/pod` 6 | export LANG=en_US.UTF-8 7 | export LANGUAGE=en_US.UTF-8 8 | export LC_ALL=en_US.UTF-8 9 | cd ${*} && pwd && ls -al && /usr/local/bin/pod install 10 | #cd "\"${*}\"" && pwd && ls -al && /usr/local/bin/pod install 11 | #cd $* && ls -al && p=`which pod` && $p install 12 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_action.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "icon_nav_normal_4@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "icon_nav_normal_4@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/Resources/icon_nav_normal_modify.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "filename" : "icon_nav_normal_3@2x.png", 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "filename" : "icon_nav_normal_3@3x.png", 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Model/NYSConfigManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSConfigManager.h 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/23. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NYSConfigModel.h" 11 | 12 | #define NConfig [NYSConfigManager sharedNYSConfigManager].configModel 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface NYSConfigManager : NSObject 17 | 18 | + (NYSConfigManager *)sharedNYSConfigManager; 19 | 20 | @property (nonatomic, strong) NYSConfigModel *configModel; 21 | 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/MainWindowView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowView.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "MainWindowView.h" 10 | 11 | @implementation MainWindowView 12 | 13 | - (void)drawRect:(NSRect)dirtyRect { 14 | [super drawRect:dirtyRect]; 15 | 16 | // Drawing code here. 17 | [[NSColor clearColor] set]; 18 | NSRectFill(dirtyRect); 19 | NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:dirtyRect xRadius:5 yRadius:5]; 20 | [[NSColor whiteColor] set]; 21 | [path fill]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSImageTextButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSImageTextButton.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSImageTextButton : NSButton 12 | 13 | @property (nonatomic) int fontSize; 14 | 15 | - (void)setImage:(NSString *)normal 16 | withHover:(NSString *)hover 17 | disable:(NSString *)disable; 18 | 19 | - (void)setTitle:(NSString *)title 20 | withNormalColor:(NSColor *)normal 21 | hoverColor:(NSColor *)hover 22 | disableColor:(NSColor *)disable; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Categories/NSColor+RGBValue.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSColor+NSColor_RGBValue.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSColor (NSColor_RGBValue) 12 | 13 | + (NSColor *)colorWithRGB:(int)red 14 | green:(int)green 15 | blue:(int)blue; 16 | 17 | + (NSColor *)colorWithRGBA:(int)red 18 | green:(int)green 19 | blue:(int)blue 20 | alpha:(CGFloat)alpha; 21 | 22 | + (NSColor *)colorWithRGBInt:(uint32_t)rgb; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/MainWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowController.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "MainWindowController.h" 10 | 11 | @interface MainWindowController () 12 | 13 | @end 14 | 15 | @implementation MainWindowController 16 | 17 | - (void)windowDidLoad { 18 | [super windowDidLoad]; 19 | 20 | // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. 21 | } 22 | 23 | - (NSString *)windowNibName { 24 | return @"MainWindow"; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/YYModel/YYModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYModel.h 3 | // YYModel 4 | // 5 | // Created by ibireme on 15/5/10. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | #if __has_include() 15 | FOUNDATION_EXPORT double YYModelVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char YYModelVersionString[]; 17 | #import 18 | #import 19 | #else 20 | #import "NSObject+YYModel.h" 21 | #import "YYClassInfo.h" 22 | #endif 23 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/NYSUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSUtils.h 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/22. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NYSUtils : NSObject 14 | 15 | + (void)showAlertPanel:(NSString *)info forWindow:(NSWindow *)window completionHandler:(void (^ _Nullable)(NSModalResponse returnCode))handler; 16 | 17 | + (NSImage *)changeImage:(NSImage *)aImage WithTintColor:(NSColor *)tintColor; 18 | 19 | + (BOOL)blankString:(NSString *)string; 20 | 21 | + (NSString *)generateRandomString:(int)lenght; 22 | 23 | + (NSString *)getCapitalString:(NSString *)str; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Model/NYSConfigManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSConfigManager.m 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/23. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import "NYSConfigManager.h" 10 | 11 | @implementation NYSConfigManager 12 | 13 | + (NYSConfigManager *)sharedNYSConfigManager { 14 | static NYSConfigManager *sharedNYSConfigManager = nil; 15 | static dispatch_once_t onceToken; 16 | dispatch_once(&onceToken, ^{ 17 | sharedNYSConfigManager = [[self alloc] init]; 18 | }); 19 | return sharedNYSConfigManager; 20 | } 21 | 22 | - (NYSConfigModel *)configModel { 23 | if (!_configModel) { 24 | _configModel = [NYSConfigModel new]; 25 | } 26 | return _configModel; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSImageButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSImageButton.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NYSImageButton : NSButton 12 | 13 | - (void)setImage:(NSString *)normal 14 | isAutoFit:(BOOL)isAutoFit; 15 | 16 | - (void)setImage:(NSString *)normal 17 | withHover:(NSString *)hover; 18 | 19 | - (void)setImage:(NSString *)normal 20 | withHover:(NSString *)hover 21 | withDisabled:(NSString *)disabled; 22 | 23 | - (void)setTitle:(NSString *)title 24 | withNormalColor:(NSColor *)normal 25 | hoverColor:(NSColor *)hover; 26 | 27 | - (void)setMouseEntered; 28 | 29 | - (void)setMouseExited; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/NYSTool.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NYSTool.swift 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/6. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class NYSTool { 12 | static func imageChangeColor(tintColor: NSColor, oldImage: NSImage) -> NSImage { 13 | if oldImage.isTemplate == false { 14 | return oldImage 15 | } 16 | 17 | let image = oldImage.copy() as! NSImage 18 | image.lockFocus() 19 | 20 | tintColor.set() 21 | 22 | let imageRect = NSRect(origin: .zero, size: image.size) 23 | imageRect.fill(using: .sourceIn) 24 | 25 | image.unlockFocus() 26 | image.isTemplate = false 27 | 28 | return image 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/MainWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindow.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "MainWindow.h" 10 | 11 | @implementation MainWindow 12 | 13 | - (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)style backing:(NSBackingStoreType)backingStoreType defer:(BOOL)flag { 14 | self = [super initWithContentRect:contentRect styleMask:style backing:backingStoreType defer:flag]; 15 | if (self != nil) { 16 | [self setOpaque:NO]; 17 | [self setStyleMask:NSWindowStyleMaskBorderless]; 18 | [self setBackgroundColor:[NSColor clearColor]]; 19 | [self setMovableByWindowBackground:YES]; 20 | } 21 | return self; 22 | } 23 | 24 | - (BOOL)canBecomeKeyWindow { 25 | return YES; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Navigation/NYSNavigateItemVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNavigateItemVC.h 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol NYSNavigateItemVCDelegate 12 | 13 | @required 14 | - (void)navigateItemOnclicked:(NSInteger)index; 15 | 16 | @end 17 | 18 | @interface NYSNavigateItemVC : NSViewController 19 | 20 | - (void)setImageAndTitle:(NSString *)title withIcon:(NSString *)normal isAutoFit:(BOOL)isAutoFit index:(NSInteger)index viewRect:(NSRect)rect; 21 | 22 | - (void)setImageAndTitle:(NSString*)title withNormalIcon:(NSString*)normal hoverIcon:(NSString*)hover index:(NSInteger)index viewRect:(NSRect)rect; 23 | 24 | - (void)setBkColor:(NSColor*)color; 25 | 26 | @property (nonatomic, weak) id delegate; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Navigation/NYSNavigateView.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNavigateView.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSNavigateView.h" 10 | 11 | @implementation NYSNavigateView 12 | 13 | - (void)drawRect:(NSRect)dirtyRect { 14 | [super drawRect:dirtyRect]; 15 | 16 | // Drawing code here. 17 | NSBezierPath *path = [NSBezierPath bezierPath]; 18 | NSRect rect = [self bounds]; 19 | [path moveToPoint:NSMakePoint(rect.size.width - 1, 0)]; 20 | [path lineToPoint:NSMakePoint(rect.size.width - 1, rect.size.height)]; 21 | 22 | [[NSColor colorWithRGBInt:0xdddfe4] set]; 23 | [path setLineWidth:1.0]; 24 | [path stroke]; 25 | } 26 | 27 | - (BOOL)mouseDownCanMoveWindow { 28 | return NO; 29 | } 30 | 31 | - (BOOL)isFlipped { 32 | return YES; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Model/EasyRelease.json: -------------------------------------------------------------------------------- 1 | { 2 | "isSasS": false, 3 | "isAuto": false, 4 | "isAutoPodInstall": false, 5 | "isRehashImages": false, 6 | "isDelAnnotation": true, 7 | "replaceArray": [ 8 | { 9 | "Type": "class", 10 | "OldPrefix": "NYS", 11 | "NewPrefix": "NYSC", 12 | "Enable": "1" 13 | }, 14 | { 15 | "Type": "method", 16 | "OldPrefix": "NYS", 17 | "NewPrefix": "NYSM", 18 | "Enable": "0" 19 | } 20 | ], 21 | "projectFileDirUrl": "file:\/\/\/Users\/niyongsheng\/Desktop\/EasyRelease\/EasyRelease.xcodeproj", 22 | "projectDirUrl": "file:\/\/\/Users\/niyongsheng\/Desktop\/EasyRelease\/EasyRelease\/", 23 | "ignoreArray": [ 24 | { 25 | "name": "Pods", 26 | "enable": "1" 27 | } 28 | ], 29 | "projectOldName": "EasyRelease", 30 | "projectNewName": "EasyReleaseNew", 31 | "version": "1.0", 32 | "desc": "https://github.com/niyongsheng/EasyRelease" 33 | } 34 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Model/NYSConfigModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // NYSConfigModel.h 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/20. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NYSConfigModel : NSObject 14 | @property (nonatomic, strong) NSURL *projectFileDirUrl; 15 | @property (nonatomic, strong) NSURL *projectDirUrl; 16 | @property (nonatomic, strong) NSMutableArray *replaceArray; 17 | @property (nonatomic, strong) NSMutableArray *ignoreArray; 18 | @property (nonatomic, strong) NSString *projectOldName; 19 | @property (nonatomic, strong) NSString *projectNewName; 20 | @property (nonatomic, assign) BOOL isDelAnnotation; 21 | @property (nonatomic, assign) BOOL isRehashImages; 22 | @property (nonatomic, assign) BOOL isAutoPodInstall; 23 | @property (nonatomic, assign) BOOL isAuto; 24 | @property (nonatomic, assign) BOOL isSasS; 25 | @property (nonatomic, strong) NSString *version; 26 | @property (nonatomic, strong) NSString *desc; 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 倪永胜 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Navigation/NYSNavigateItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNavigateItem.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSNavigateItem.h" 10 | 11 | @interface NSView (MouseEvent) 12 | 13 | - (void)setMouseEntered; 14 | 15 | - (void)setMouseExited; 16 | 17 | @end 18 | 19 | @implementation NYSNavigateItem 20 | 21 | @synthesize bkColor = _bkColor; 22 | 23 | - (void)drawRect:(NSRect)dirtyRect { 24 | [super drawRect:dirtyRect]; 25 | // Drawing code here. 26 | [_bkColor setFill]; 27 | NSRectFill(dirtyRect); 28 | } 29 | 30 | - (void)mouseEntered:(NSEvent *)theEvent { 31 | _bkColor = [NSColor colorWithRGBInt:SelectBackgroundColor]; 32 | [super mouseEntered:theEvent]; 33 | for (NSView *sub in [self subviews]) { 34 | [sub setMouseEntered]; 35 | } 36 | } 37 | 38 | - (void)mouseExited:(NSEvent *)theEvent { 39 | _bkColor = [NSColor colorWithRGBInt:0xffffff]; 40 | [super mouseExited:theEvent]; 41 | for (NSView *sub in [self subviews]) { 42 | [sub setMouseExited]; 43 | } 44 | } 45 | 46 | - (BOOL)isFlipped { 47 | return YES; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/ArtHUDView.m: -------------------------------------------------------------------------------- 1 | #import "ArtHUDView.h" 2 | #import 3 | 4 | 5 | @implementation ArtHUDView 6 | 7 | - (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)style backing:(NSBackingStoreType)backingStoreType defer:(BOOL)flag 8 | { 9 | if (self = [super initWithContentRect:contentRect styleMask:style backing:backingStoreType defer:flag]) 10 | { 11 | [self setStyleMask:NSWindowStyleMaskBorderless]; 12 | [self setOpaque:NO]; 13 | [self setBackgroundColor:[NSColor clearColor]]; 14 | } 15 | 16 | return self; 17 | } 18 | 19 | - (void)setContentView:(NSView *)aView { 20 | [aView setWantsLayer:YES]; 21 | // aView.layer.backgroundColor = CGColorGetConstantColor(kCGColorBlack); 22 | aView.layer.backgroundColor = [NSColor systemGrayColor].CGColor; 23 | aView.layer.cornerRadius = 20; 24 | aView.layer.masksToBounds = YES; 25 | [super setContentView:aView]; 26 | } 27 | 28 | - (void)setCornerRadius:(CGFloat)cornerRadius { 29 | _cornerRadius = cornerRadius; 30 | NSView *view = self.contentView; 31 | view.layer.cornerRadius = cornerRadius; 32 | } 33 | @end 34 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // easyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/4. 6 | // 7 | 8 | #import "AppDelegate.h" 9 | #import "MainWindowController.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @property (nonatomic, strong) MainWindowController *mainWindowController; 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 20 | [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints"]; 21 | [[NSUserDefaults standardUserDefaults] synchronize]; 22 | 23 | self.mainWindowController = [[MainWindowController alloc] init]; 24 | [[_mainWindowController window] center]; 25 | [_mainWindowController showWindow:self]; 26 | self.mainWC = _mainWindowController; 27 | 28 | self.updater = [GitHubUpdater new]; 29 | self.updater.user = @"niyongsheng"; 30 | self.updater.repository = @"EasyRelease"; 31 | [self.updater checkForUpdatesInBackground]; 32 | } 33 | 34 | 35 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 36 | // Insert code here to tear down your application 37 | } 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Categories/NSColor+RGBValue.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSColor+NSColor_RGBValue.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NSColor+RGBValue.h" 10 | 11 | @implementation NSColor (NSColor_RGBValue) 12 | 13 | + (NSColor *)colorWithRGB:(int)red 14 | green:(int)green 15 | blue:(int)blue { 16 | CGFloat r = red / 255.0; 17 | CGFloat g = green / 255.0; 18 | CGFloat b = blue / 255.0; 19 | return [NSColor colorWithCalibratedRed:r green:g blue:b alpha:1.0]; 20 | } 21 | 22 | + (NSColor *)colorWithRGBA:(int)red 23 | green:(int)green 24 | blue:(int)blue 25 | alpha:(CGFloat)alpha { 26 | CGFloat r = red / 255.0; 27 | CGFloat g = green / 255.0; 28 | CGFloat b = blue / 255.0; 29 | return [NSColor colorWithCalibratedRed:r green:g blue:b alpha:alpha]; 30 | } 31 | 32 | + (NSColor *)colorWithRGBInt:(uint32_t)rgb { 33 | CGFloat r = ((rgb & 0xff0000) >> 16) / 255.0; 34 | CGFloat g = ((rgb & 0x00ff00) >> 8) / 255.0; 35 | CGFloat b = ((rgb & 0x0000ff) >> 0) / 255.0; 36 | return [NSColor colorWithCalibratedRed:r green:g blue:b alpha:1.0]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 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 | LSApplicationCategoryType 24 | public.app-category.utilities 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | NSRequiresAquaSystemAppearance 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSFitSizeTextButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSFitSizeTextButton.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSFitSizeTextButton.h" 10 | 11 | @interface NYSFitSizeTextButton () 12 | 13 | @property (nonatomic) CGFloat maxWidth; 14 | 15 | - (void)fitIt; 16 | 17 | @end 18 | 19 | @implementation NYSFitSizeTextButton 20 | 21 | - (void)drawRect:(NSRect)dirtyRect { 22 | [super drawRect:dirtyRect]; 23 | 24 | // Drawing code here. 25 | } 26 | 27 | - (instancetype)initWithFrame:(NSRect)frameRect { 28 | self = [super initWithFrame:frameRect]; 29 | [self setLineBreakMode:NSLineBreakByTruncatingTail]; 30 | _maxWidth = NSWidth(frameRect); 31 | return self; 32 | } 33 | 34 | - (void)setTitle:(NSString *)title withNormalColor:(NSColor *)normal hoverColor:(NSColor *)hover { 35 | [super setTitle:title withNormalColor:normal hoverColor:hover]; 36 | [self fitIt]; 37 | } 38 | 39 | - (void)setTitle:(NSString *)title { 40 | [super setTitle:title]; 41 | [super setMouseExited]; 42 | [self fitIt]; 43 | } 44 | 45 | - (void)fitIt { 46 | [self sizeToFit]; 47 | NSSize newSize = self.frame.size; 48 | if (newSize.width > _maxWidth) { 49 | [self setFrameSize:NSMakeSize(_maxWidth, newSize.height)]; 50 | } 51 | } 52 | @end 53 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/NullSafe.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | 5 | #ifndef NULLSAFE_ENABLED 6 | #define NULLSAFE_ENABLED 1 7 | #endif 8 | 9 | 10 | #pragma clang diagnostic ignored "-Wgnu-conditional-omitted-operand" 11 | 12 | 13 | @implementation NSNull (NullSafe) 14 | 15 | #if NULLSAFE_ENABLED 16 | 17 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector { 18 | NSMethodSignature *signature = [super methodSignatureForSelector:selector]; 19 | if (!signature) 20 | { 21 | for (Class someClass in @[ 22 | [NSMutableArray class], 23 | [NSMutableDictionary class], 24 | [NSMutableString class], 25 | [NSNumber class], 26 | [NSDate class], 27 | [NSData class] 28 | ]) 29 | { 30 | @try 31 | { 32 | if ([someClass instancesRespondToSelector:selector]) 33 | { 34 | signature = [someClass instanceMethodSignatureForSelector:selector]; 35 | break; 36 | } 37 | } 38 | @catch (__unused NSException *unused) {} 39 | } 40 | } 41 | return signature; 42 | } 43 | 44 | - (void)forwardInvocation:(NSInvocation *)invocation { 45 | invocation.target = nil; 46 | [invocation invoke]; 47 | } 48 | 49 | #endif 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSContentView.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSContentView.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSContentView.h" 10 | 11 | @implementation NYSContentView 12 | 13 | - (void)drawRect:(NSRect)dirtyRect { 14 | [super drawRect:dirtyRect]; 15 | 16 | // Drawing code here. 17 | NSBezierPath *path = [NSBezierPath bezierPath]; 18 | NSRect rect = [self bounds]; 19 | [path moveToPoint:NSMakePoint(0, 0)]; 20 | [path lineToPoint:NSMakePoint(rect.size.width, 0)]; 21 | [[NSColor colorWithRGBInt:0xdddfe4] set]; 22 | [path stroke]; 23 | 24 | [path moveToPoint:NSMakePoint(0, 0)]; 25 | [path lineToPoint:NSMakePoint(rect.size.width, 0)]; 26 | [path lineToPoint:NSMakePoint(rect.size.width, rect.size.height - 15)]; 27 | [path curveToPoint:NSMakePoint(rect.size.width - 15, rect.size.height) 28 | controlPoint1:NSMakePoint(rect.size.width, rect.size.height) 29 | controlPoint2:NSMakePoint(rect.size.width, rect.size.height)]; 30 | [path lineToPoint:NSMakePoint(0, rect.size.height)]; 31 | [path lineToPoint:NSMakePoint(0, 0)]; 32 | [[NSColor colorWithRGBInt:0xf1f3f7] set]; 33 | [path appendBezierPathWithRect:NSMakeRect(-1, -1, rect.size.width, 1)]; 34 | [path fill]; 35 | } 36 | 37 | - (BOOL)isFlipped { 38 | return YES; 39 | } 40 | 41 | - (BOOL)mouseDownCanMoveWindow { 42 | return NO; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/ArtProgressHUD.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | typedef NS_ENUM(NSUInteger, EArtProgressHUDType){ 4 | EArtProgressHUDInfo = 0, //有图片的显示文本 5 | EArtProgressHUDWarning, //警告 6 | EArtProgressHUDError, //错误 7 | EArtProgressHUDSuccess, //成功 8 | EArtProgressHUDLoading, //loading 9 | EArtProgressHUDTypeNone //无图片纯文字 10 | }; 11 | 12 | @interface ArtProgressHUD : NSWindowController 13 | 14 | 15 | /** 16 | 吐司提示文字 无图片对应 EArtProgressHUDTypeNone 17 | 18 | @param aText 提示文本 19 | */ 20 | + (void)showText:(NSString *)aText; 21 | 22 | 23 | /** 24 | 信息提示 EArtProgressHUDInfo 25 | 26 | @param aText 提示文本 27 | */ 28 | + (void)showInfoText:(NSString *)aText; 29 | 30 | 31 | /** 32 | 错误提示 EArtProgressHUDError 33 | 34 | @param aText 提示文本 35 | */ 36 | + (void)showErrorText:(NSString *)aText; 37 | 38 | 39 | /** 40 | 成功提示 EArtProgressHUDSuccess 41 | 42 | @param aText 提示文本 43 | */ 44 | + (void)showSuccessText:(NSString *)aText; 45 | 46 | 47 | /** 48 | 文本提示 如果需要制定文本的位置view 使用这个方法 默认在整个window中提示 49 | 50 | @param aText 提示文本 51 | @param aType 提示类型 52 | @param aView 提示的位置 53 | */ 54 | + (void)showText:(NSString *)aText type:(EArtProgressHUDType)aType inView:(NSView *)aView; 55 | 56 | 57 | /** 58 | 展示loading 59 | */ 60 | + (void)showLoading; 61 | 62 | /** 63 | 在某个view上展示loading 64 | 65 | @param aView 对应的view 66 | */ 67 | + (void)showLoading:(NSView *)aView; 68 | 69 | 70 | /** 71 | view消失 72 | */ 73 | + (void)dismissLoading; 74 | @end 75 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/TitleBar/NYSTitleBarView.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSTitleBarView.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSTitleBarView.h" 10 | 11 | @implementation NYSTitleBarView 12 | 13 | - (void)drawRect:(NSRect)dirtyRect { 14 | [super drawRect:dirtyRect]; 15 | 16 | // Drawing code here. 17 | [[NSColor clearColor] set]; 18 | NSRectFill(dirtyRect); 19 | 20 | NSBezierPath *path = [NSBezierPath bezierPath]; 21 | NSRect rect = [self bounds]; 22 | [path moveToPoint:NSMakePoint(0, 15)]; 23 | [path curveToPoint:NSMakePoint(15, 0) 24 | controlPoint1:NSMakePoint(0, 0) 25 | controlPoint2:NSMakePoint(0, 0)]; 26 | [path lineToPoint:NSMakePoint(rect.size.width - 15, 0)]; 27 | [path curveToPoint:NSMakePoint(rect.size.width, 15) 28 | controlPoint1:NSMakePoint(rect.size.width, 0) 29 | controlPoint2:NSMakePoint(rect.size.width, 0)]; 30 | [path lineToPoint:NSMakePoint(rect.size.width, rect.size.height)]; 31 | [path lineToPoint:NSMakePoint(0, rect.size.height)]; 32 | [path lineToPoint:NSMakePoint(0, 15)]; 33 | 34 | [[NSColor colorWithRGBInt:ThemeColor] set]; 35 | [path fill]; 36 | 37 | [path moveToPoint:NSMakePoint(rect.size.width - 78, 17)]; 38 | [path lineToPoint:NSMakePoint(rect.size.width - 78, 43)]; 39 | [[NSColor colorWithRGBInt:TitleBarBorderColor] set]; 40 | [path stroke]; 41 | } 42 | 43 | - (BOOL)isFlipped { 44 | return YES; 45 | } 46 | 47 | - (BOOL)mouseDownCanMoveWindow { 48 | return YES; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 20D80 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | GitHubUpdates 11 | CFBundleIdentifier 12 | com.xs-labs.GitHubUpdates 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | GitHubUpdates 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 12D4e 31 | DTPlatformName 32 | macosx 33 | DTPlatformVersion 34 | 11.1 35 | DTSDKBuild 36 | 20C63 37 | DTSDKName 38 | macosx11.1 39 | DTXcode 40 | 1240 41 | DTXcodeBuild 42 | 12D4e 43 | LSMinimumSystemVersion 44 | 10.12 45 | NSHumanReadableCopyright 46 | Copyright © 2017 XS-Labs. All rights reserved. 47 | 48 | 49 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/TitleBar/NYSNoticeView.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNoticeView.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSNoticeView.h" 10 | 11 | @interface NSView (MouseEvent) 12 | 13 | - (void)setMouseEntered; 14 | 15 | - (void)setMouseExited; 16 | 17 | @end 18 | 19 | @interface NYSNoticeView () 20 | 21 | @property (nonatomic, strong) NSTrackingArea *trackingArea; 22 | 23 | @end 24 | 25 | @implementation NYSNoticeView 26 | 27 | - (void)drawRect:(NSRect)dirtyRect { 28 | [super drawRect:dirtyRect]; 29 | 30 | // Drawing code here. 31 | } 32 | 33 | - (void)updateTrackingAreas { 34 | if (self.trackingArea != nil) { 35 | [self removeTrackingArea:self.trackingArea]; 36 | } 37 | int ops = (NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways); 38 | self.trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] 39 | options:ops 40 | owner:self 41 | userInfo:nil]; 42 | [self addTrackingArea:self.trackingArea]; 43 | } 44 | 45 | - (void)mouseEntered:(NSEvent *)theEvent { 46 | [super mouseEntered:theEvent]; 47 | for (NSView *sub in [self subviews]) { 48 | [sub setMouseEntered]; 49 | } 50 | } 51 | 52 | - (void)mouseExited:(NSEvent *)theEvent { 53 | [super mouseExited:theEvent]; 54 | for (NSView *sub in [self subviews]) { 55 | [sub setMouseExited]; 56 | } 57 | } 58 | 59 | - (BOOL)isFlipped { 60 | return YES; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/5. 6 | // 7 | 8 | #ifndef PrefixHeader_pch 9 | #define PrefixHeader_pch 10 | 11 | // Include any system framework and library headers here that should be included in all compilation units. 12 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 13 | 14 | #define Theme_blue 1 15 | #define Theme_red 0 16 | #define Theme_green 0 17 | 18 | #if Theme_red 19 | /** 红色主题*/ 20 | #define ThemeColor 0xEF4D4D 21 | #define TitleBarBorderColor 0xFF89B0 22 | #define SelectBackgroundColor 0xF4F6F9 23 | #define MainFontColor 0x6d757a 24 | #define ItemHeight 60 25 | #elif Theme_blue 26 | /** 蓝色主题*/ 27 | #define ThemeColor 0x4885FC 28 | #define TitleBarBorderColor 0xD6D8DC 29 | #define SelectBackgroundColor 0xF4F6F9 30 | #define MainFontColor 0x6d757a 31 | #define ItemHeight 60 32 | #elif Theme_green 33 | /** 绿色主题*/ 34 | #define ThemeColor 0x28C840 35 | #define TitleBarBorderColor 0xD6D8DC 36 | #define SelectBackgroundColor 0xF4F6F9 37 | #define MainFontColor 0x6d757a 38 | #define ItemHeight 60 39 | #endif 40 | 41 | #define ER_GH @"https://github.com/niyongsheng/EasyRelease" 42 | 43 | #import "EasyRelease-Bridging-Header.h" 44 | #import "EasyRelease-Swift.h" 45 | #import "NYSUtils.h" 46 | #import "ArtProgressHUD.h" 47 | #import "NYSConfigManager.h" 48 | #import "NSColor+RGBValue.h" 49 | 50 | #define ChangeNavNotice @"NYSChangeNavigationNotification" 51 | #define RefreshConfNotice @"NYSRefreshConfigNotification" 52 | #define ActionInfoNotice @"NYSActionInfoNotification" 53 | 54 | #endif /* PrefixHeader_pch */ 55 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Model/NYSConfigModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSConfigModel.m 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/20. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import "NYSConfigModel.h" 10 | #import "YYModel.h" 11 | 12 | @implementation NYSConfigModel 13 | - (NSUInteger)hash { 14 | return [self yy_modelHash]; 15 | } 16 | 17 | - (BOOL)isEqual:(id)object { 18 | return [self yy_modelIsEqual:object]; 19 | } 20 | 21 | /// 自定义model转换 22 | - (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic { 23 | NSString *pfd = dic[@"projectFileDirUrl"]; 24 | NSString *pd = dic[@"projectDirUrl"]; 25 | if (![pfd isKindOfClass:[NSString class]] || ![pd isKindOfClass:[NSString class]]) return NO; 26 | NSString *charactersToEscape = @"?!@#$^&%*+,:;='\"`<>()[]{}/\\| "; 27 | NSCharacterSet *allowedCharacters = [[NSCharacterSet characterSetWithCharactersInString:charactersToEscape] invertedSet]; 28 | _projectFileDirUrl = [NSURL URLWithString:[pfd stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacters]]; 29 | _projectDirUrl = [NSURL URLWithString:[pd stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacters]]; 30 | return YES; 31 | } 32 | 33 | - (BOOL)modelCustomTransformToDictionary:(NSMutableDictionary *)dic { 34 | NSString *version = dic[@"version"]; 35 | NSString *desc = dic[@"desc"]; 36 | if (![version isKindOfClass:[NSString class]] || ![desc isKindOfClass:[NSString class]]) return NO; 37 | NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 38 | NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; 39 | dic[@"version"] = app_Version; 40 | dic[@"desc"] = ER_GH; 41 | return YES; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/TitleBar/NYSNoticeVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNoticeVC.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSNoticeVC.h" 10 | #import "NYSNoticeView.h" 11 | #import "NYSImageButton.h" 12 | #import "NYSFitSizeTextButton.h" 13 | 14 | @interface NYSNoticeVC () 15 | 16 | @property (nonatomic, strong) NYSNoticeView *noticeView; 17 | 18 | @property (nonatomic, strong) NYSFitSizeTextButton *noticeText; 19 | 20 | @end 21 | 22 | @implementation NYSNoticeVC 23 | 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | // Do view setup here. 27 | NYSImageButton *noticeIcon = [[NYSImageButton alloc] 28 | initWithFrame:NSMakeRect(0, 1, 16, 16)]; 29 | [noticeIcon setImage:@"icon_notice" isAutoFit:NO]; 30 | [self.view addSubview:noticeIcon]; 31 | 32 | NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 33 | NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; 34 | 35 | _noticeText = [[NYSFitSizeTextButton alloc] initWithFrame:NSMakeRect(22, 0, 400, 15)]; 36 | [_noticeText setTitle:[NSString stringWithFormat:@"How to user EasyRelease v%@,please visit in GitHub.", app_Version] 37 | withNormalColor:[NSColor colorWithRGBInt:0xffffff] 38 | hoverColor:[NSColor colorWithRGBInt:0xffffff]]; 39 | [_noticeText setTarget:self]; 40 | [_noticeText setAction:@selector(noticeBtnClicked:)]; 41 | [self.view addSubview:_noticeText]; 42 | } 43 | 44 | - (void)loadView { 45 | _noticeView = [[NYSNoticeView alloc] initWithFrame:NSMakeRect(190, 21, 400, 16)]; 46 | self.view = _noticeView; 47 | } 48 | 49 | - (void)noticeBtnClicked:(id)sender { 50 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:ER_GH]]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/SupportingFiles/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "size": "16x16", 5 | "idiom": "mac", 6 | "filename": "icon-16.png", 7 | "scale": "1x" 8 | }, 9 | { 10 | "size": "16x16", 11 | "idiom": "mac", 12 | "filename": "icon-16@2x.png", 13 | "scale": "2x" 14 | }, 15 | { 16 | "size": "32x32", 17 | "idiom": "mac", 18 | "filename": "icon-32.png", 19 | "scale": "1x" 20 | }, 21 | { 22 | "size": "32x32", 23 | "idiom": "mac", 24 | "filename": "icon-32@2x.png", 25 | "scale": "2x" 26 | }, 27 | { 28 | "size": "128x128", 29 | "idiom": "mac", 30 | "filename": "icon-128.png", 31 | "scale": "1x" 32 | }, 33 | { 34 | "size": "128x128", 35 | "idiom": "mac", 36 | "filename": "icon-128@2x.png", 37 | "scale": "2x" 38 | }, 39 | { 40 | "size": "256x256", 41 | "idiom": "mac", 42 | "filename": "icon-256.png", 43 | "scale": "1x" 44 | }, 45 | { 46 | "size": "256x256", 47 | "idiom": "mac", 48 | "filename": "icon-256@2x.png", 49 | "scale": "2x" 50 | }, 51 | { 52 | "size": "512x512", 53 | "idiom": "mac", 54 | "filename": "icon-512.png", 55 | "scale": "1x" 56 | }, 57 | { 58 | "size": "512x512", 59 | "idiom": "mac", 60 | "filename": "icon-512@2x.png", 61 | "scale": "2x" 62 | } 63 | ], 64 | "info": { 65 | "version": 1, 66 | "author": "NYS" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | 28 | ## App packaging 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | # CocoaPods 34 | # 35 | # We recommend against adding the Pods directory to your .gitignore. However 36 | # you should judge for yourself, the pros and cons are mentioned at: 37 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 38 | # 39 | # Pods/ 40 | # 41 | # Add this line if you want to avoid checking in source code from the Xcode workspace 42 | # *.xcworkspace 43 | 44 | # Carthage 45 | # 46 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 47 | # Carthage/Checkouts 48 | 49 | Carthage/Build/ 50 | 51 | # fastlane 52 | # 53 | # It is recommended to not store the screenshots in the git repo. 54 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 55 | # For more information about the recommended setup visit: 56 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 57 | 58 | fastlane/report.xml 59 | fastlane/Preview.html 60 | fastlane/screenshots/**/*.png 61 | fastlane/test_output 62 | 63 | # Code Injection 64 | # 65 | # After new code Injection tools there's a generated folder /iOSInjectionProject 66 | # https://github.com/johnno1962/injectionforxcode 67 | 68 | iOSInjectionProject/ 69 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Headers/GitHubUpdates.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header GitHubUpdates.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | * @abstract Umbrella header for the GitHubUpdates framework/module. 29 | */ 30 | 31 | #import 32 | #import 33 | #import 34 | #import 35 | #import 36 | #import 37 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Model/logo_str.erc: -------------------------------------------------------------------------------- 1 | @@@@@@@@@@@@@@@@@@@@@@@@@@@/` ,\@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2 | @@@@@@@@@@@@@@@@@@@@@@@@@` ,@@@@@@@@@@@@@@@@@@@@@@@@@ 3 | @@@@@@@@@@@@@@@@@@@@@@@` =\@@@@@@@@@@@@@@@@@@@@@@@@ 4 | @@@@@@@@@@@@[[ [O@@\` /@O@@@@@@@@@@@@@@@@@@@@@@@ 5 | @@@@@@@@` ,O@\ /@@O@@@@@@@@@@@@@@@@@@@@@@@ 6 | @@@@@@ \@\ ,O@@O=@@@@@@@@@@@@@@@@@@@@@@@ 7 | @@@@@@@` \@]O@@@O\@@@@@@@@@@@@@@@@@@@@@@@@ 8 | @@@@@@@@@` O@@@O\@/.,@@@@@@@@@@@@@@@@@@@@@@ 9 | @@@@@@@@@@@` @@O\@/.....,@@@@@@@@@@@@@@@@@@@@ 10 | @@@@@@@@@@@@@` ,@O@@@@@`.....,@@@@@@@@@@@@@@@@@@ 11 | @@@@@@@@@@@` \@` O@@/@@@@@@`.....,@@@@@@@@@@@@@@@@ 12 | @@@@@@@@@@@ \@` /@@@O@@@@@@@@`.....,@@@@@@@@@@@@@@ 13 | @@@@@@@@@@@^ \@` /@@@@=@@@@@@@@@@`.....,@@@@@@@@@@@@ 14 | @@@@@@@@@@@@\ \@` ,O@@@@/@@@@@@@@@@@@@`.....,@@@@@@@@@@ 15 | @@@@@@@@@@@@@@@@]]/@@@@` /@@@@@O/@@@@@@@@@@@@@@@`....]@@@@@@@@@ 16 | @@@@@@@@@@@@@@@@@@@@@@@@@/O@@@O/@@@@@@@@@@@@@@@@@@]@/....\@@@@@ 17 | @@@@@@@@@@@@@@@@@@@@@@@@@@@/Oo@@@@@@@@@@@@@@@@@@@@@@......@@@@@ 18 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@......@@@@@ 19 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`.,\@@@@@@@@@@ 20 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`.....,@@@@@@@@@ 21 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`.....,@@@@@@@@@@@ 22 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`.....,@@@@@@@@@@@@@ 23 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`.....,@@@@@@@@@@@@@@@ 24 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`.....,@@@@@@@@@@@@@@@@@ 25 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`.....,@@@@@@@@@@@@@@@@@@@ 26 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`.....,@@@@@@@@@@@@@@@@@@@@@ 27 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O]]...,@@@@@@@@@@@@@@@@@@@@@@@ 28 | @@@@@@@@@@@@@@@@@@@@@@@@@@@/` ,[OO@@@@@@@@@@@@@@@@@@@@@@@@@ 29 | @@@@@@@@@@@@@@@@@@@@@@@@/ \@@@@@@@@@@@@@@@@@@@@@@@ 30 | @@@@@@@@@@@@@@@@@@@@@@@` ,@@@@@@@@@@@@@@@@@@@@@@ 31 | @@@@@@@@@@@@@@@@@@@@@@` ,@@@@@@@@@@@@@@@@@@@@@ 32 | @@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@ 33 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/PrivateHeaders/NSError+GitHubUpdates.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header NSError+GitHubUpdates.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | 32 | NS_ASSUME_NONNULL_BEGIN 33 | 34 | /*! 35 | * @category NSError( GitHubUpdates ) 36 | * @abstract Additional methods for NSError. 37 | */ 38 | @interface NSError( GitHubUpdates ) 39 | 40 | /*! 41 | * @method errorWithException: 42 | * @abstract Creates an error object from an exception object. 43 | * @param exception The exception object 44 | * @result The error object 45 | */ 46 | + ( instancetype )errorWithException: ( NSException * )exception; 47 | 48 | @end 49 | 50 | NS_ASSUME_NONNULL_END 51 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSRoundImageButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSRoundImageButton.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSRoundImageButton.h" 10 | 11 | @interface NSImage (ScaleToRound) 12 | 13 | - (NSImage *)getRoundImage:(CGFloat)radius; 14 | 15 | @end 16 | 17 | @implementation NSImage (ScaleToRound) 18 | 19 | - (NSImage *)getRoundImage:(CGFloat)radius { 20 | NSSize roundSize = NSMakeSize(radius, radius); 21 | NSImage *roundImage = [[NSImage alloc] initWithSize:roundSize]; 22 | 23 | [roundImage lockFocus]; 24 | [self setSize:roundSize]; 25 | [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationHigh]; 26 | NSRect imageFrame = NSMakeRect(0, 0, radius, radius); 27 | NSBezierPath *clipPath = [NSBezierPath bezierPathWithRoundedRect:imageFrame xRadius:radius yRadius:radius]; 28 | [clipPath setWindingRule:NSWindingRuleEvenOdd]; 29 | [clipPath addClip]; 30 | [self drawAtPoint:NSZeroPoint fromRect:imageFrame operation:NSCompositingOperationSourceOver fraction:1]; 31 | [roundImage unlockFocus]; 32 | 33 | return roundImage; 34 | } 35 | 36 | @end 37 | 38 | @interface NYSRoundImageButton () 39 | 40 | @property (nonatomic) CGFloat radius; 41 | 42 | @end 43 | 44 | @implementation NYSRoundImageButton 45 | 46 | - (void)drawRect:(NSRect)dirtyRect { 47 | [super drawRect:dirtyRect]; 48 | 49 | // Drawing code here. 50 | } 51 | 52 | - (instancetype)initWithFrame:(NSRect)frameRect { 53 | self = [super initWithFrame:frameRect]; 54 | if (frameRect.size.width != frameRect.size.height) { 55 | NSLog(@"Not a round button!"); 56 | } 57 | _radius = frameRect.size.width; 58 | [self setButtonType:NSButtonTypeMomentaryChange]; 59 | [self setBezelStyle:NSBezelStyleRoundedDisclosure]; 60 | [self setBordered:NO]; 61 | [self setImagePosition:NSImageOnly]; 62 | return self; 63 | } 64 | 65 | - (void)setImage:(NSImage *)image { 66 | NSImage *roundImage = [image getRoundImage:_radius]; 67 | [super setImage:roundImage]; 68 | [super setAlternateImage:roundImage]; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/PrivateHeaders/NSString+GitHubUpdates.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header NSString+GitHubUpdates.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | 32 | NS_ASSUME_NONNULL_BEGIN 33 | 34 | /*! 35 | * @category NSString( GitHubUpdates ) 36 | * @abstract Additional methods for NSString. 37 | */ 38 | @interface NSString( GitHubUpdates ) 39 | 40 | /*! 41 | * @method stringForSizeInBytes: 42 | * @abstract Formats a size in bytes to a human representation. 43 | * @param bytes The size in bytes 44 | * @result A string representing the size 45 | */ 46 | + ( NSString * )stringForSizeInBytes: ( NSUInteger )bytes; 47 | 48 | @end 49 | 50 | NS_ASSUME_NONNULL_END 51 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/PrivateHeaders/NSAttributedString+GitHubUpdates.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header NSAttributedString+GitHubUpdates.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | 32 | NS_ASSUME_NONNULL_BEGIN 33 | 34 | /*! 35 | * @category NSAttributedString( GitHubUpdates ) 36 | * @abstract Additional methods for NSAttributedString. 37 | */ 38 | @interface NSAttributedString( GitHubUpdates ) 39 | 40 | /*! 41 | * @method attributedStringFromMarkdownString: 42 | * @abstract Returns an attributed string from a Markdown string 43 | * @param md The Markdown string 44 | * @result An attributed string 45 | */ 46 | + ( NSAttributedString * )attributedStringFromMarkdownString: ( NSString * )md; 47 | 48 | @end 49 | 50 | NS_ASSUME_NONNULL_END 51 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSLabel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2015 Leonard Hecker 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #import 26 | 27 | IB_DESIGNABLE 28 | @interface NYSLabel : NSView 29 | 30 | @property(nonatomic, copy) IBInspectable NSString* text; 31 | @property(nonatomic, copy) NSAttributedString* attributedText; 32 | @property(nonatomic, retain) NSFont* font; 33 | @property(nonatomic, retain) IBInspectable NSColor* textColor; 34 | @property(nonatomic, retain) IBInspectable NSColor* backgroundColor; 35 | @property(nonatomic, assign) IBInspectable NSInteger numberOfLines; 36 | @property(nonatomic, assign) NSTextAlignment textAlignment; 37 | @property(nonatomic, assign) NSLineBreakMode lineBreakMode; 38 | @property(nonatomic, assign) IBInspectable CGFloat preferredMaxLayoutWidth; 39 | 40 | - (instancetype)init; 41 | - (instancetype)initWithFrame:(NSRect)frameRect NS_DESIGNATED_INITIALIZER; 42 | - (instancetype)initWithCoder:(NSCoder*)coder NS_DESIGNATED_INITIALIZER; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSShowTipViewControlle.xib: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/PrivateHeaders/NSBundle+GitHubUpdates.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header NSBundle+GitHubUpdates.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | 32 | NS_ASSUME_NONNULL_BEGIN 33 | 34 | /*! 35 | * @category NSBundle( GitHubUpdates ) 36 | * @abstract Additional methods for NSBundle. 37 | */ 38 | @interface NSBundle( GitHubUpdates ) 39 | 40 | /*! 41 | * @property isCodeSigned 42 | * @abstract Checks if the bundle is code-signed. 43 | * @discussion This will invoke the `codesign` utility. 44 | */ 45 | @property( nonatomic, readonly ) BOOL isCodeSigned; 46 | 47 | /*! 48 | * @property codeSigningIdentity 49 | * @abstract Returns the identity used to code-sign the bundle, if any. 50 | * @discussion This will invoke the `codesign` utility. 51 | */ 52 | @property( nonatomic, readonly, nullable ) NSString * codeSigningIdentity; 53 | 54 | @end 55 | 56 | NS_ASSUME_NONNULL_END 57 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/PrivateHeaders/Pair.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header Pair.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | 32 | NS_ASSUME_NONNULL_BEGIN 33 | 34 | /*! 35 | * @class Pair 36 | * @abstract Represents an object pair. 37 | */ 38 | @interface Pair< FirstType, SecondType >: NSObject 39 | 40 | /*! 41 | * @property first 42 | * @abstract The first object in the pair. 43 | */ 44 | @property( atomic, readwrite, strong, nullable ) FirstType first; 45 | 46 | /*! 47 | * @property second 48 | * @abstract The second object in the pair. 49 | */ 50 | @property( atomic, readwrite, strong, nullable ) SecondType second; 51 | 52 | /*! 53 | * @method initWithFirstValue:secondValue: 54 | * @abstract Initialized an instance of this class. 55 | * @discussion This is the class's designated initializer. 56 | * @result The initialized instance 57 | * @param v1 The first object 58 | * @param v2 The second object 59 | */ 60 | - ( instancetype )initWithFirstValue: ( nullable FirstType )v1 secondValue: ( nullable SecondType )v2 NS_DESIGNATED_INITIALIZER; 61 | 62 | @end 63 | 64 | NS_ASSUME_NONNULL_END 65 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/NYSPanelWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSPanelWindow.m 3 | // EasyRelease 4 | // 5 | // Created by niyongsheng on 2021/3/3. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import "NYSPanelWindow.h" 10 | #import "YYModel.h" 11 | 12 | @interface NYSPanelWindow () 13 | @property (weak) IBOutlet NSTextField *projectNameField; 14 | 15 | @end 16 | 17 | @implementation NYSPanelWindow 18 | 19 | - (IBAction)okOnclicked:(NSButtonCell *)sender { 20 | if ([NYSUtils blankString:_projectNameField.stringValue]) { 21 | [[NSNotificationCenter defaultCenter] postNotificationName:ActionInfoNotice object:@"\nnull value\n"]; 22 | return; 23 | } 24 | 25 | [self close]; 26 | 27 | NSString *prefixStr = _projectNameField.stringValue; 28 | NSString *capitalStr = [NYSUtils getCapitalString:prefixStr]; 29 | if (![NYSUtils blankString:NConfig.projectNewName]) { 30 | capitalStr = [NYSUtils getCapitalString:NConfig.projectNewName]; 31 | } 32 | if ([NYSUtils blankString:NConfig.projectNewName] && [NYSUtils blankString:NConfig.projectOldName]) { 33 | NConfig.projectOldName = _oldProjectName; 34 | NConfig.projectNewName = prefixStr; 35 | } else if ([NYSUtils blankString:NConfig.projectNewName] && ![NYSUtils blankString:NConfig.projectOldName]) { 36 | NConfig.projectNewName = prefixStr; 37 | } else if (![NYSUtils blankString:NConfig.projectNewName] && [NYSUtils blankString:NConfig.projectOldName]) { 38 | NConfig.projectOldName = _oldProjectName; 39 | } 40 | 41 | for (int i = 0; i < NConfig.replaceArray.count; i++) { 42 | NSDictionary *replaceDict = NConfig.replaceArray[i]; 43 | if ([NYSUtils blankString:replaceDict[@"NewPrefix"]] && ![NYSUtils blankString:replaceDict[@"OldPrefix"]]) { 44 | NSMutableDictionary *mutableReplaceDict = [NSMutableDictionary dictionaryWithDictionary:replaceDict]; 45 | NSString *newValue = [NSString stringWithFormat:@"%@_%@", capitalStr, replaceDict[@"OldPrefix"]]; 46 | if ([replaceDict[@"Type"] isEqual:@"global"]) { 47 | newValue = [NSString stringWithFormat:@"%@_", capitalStr]; 48 | } 49 | [mutableReplaceDict setValue:newValue forKey:@"NewPrefix"]; 50 | NConfig.replaceArray[i] = mutableReplaceDict; 51 | } 52 | } 53 | 54 | // 发送刷新配置通知 55 | NSString *objStr = [NConfig yy_modelToJSONString]; 56 | [[NSNotificationCenter defaultCenter] postNotificationName:RefreshConfNotice object:nil userInfo:nil]; 57 | [[NSNotificationCenter defaultCenter] postNotificationName:ActionInfoNotice object:objStr]; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/PrivateHeaders/NSMutableAttributedString+GitHubUpdates.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header NSMutableAttributedString+GitHubUpdates.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | 32 | NS_ASSUME_NONNULL_BEGIN 33 | 34 | /*! 35 | * @category NSMutableAttributedString( GitHubUpdates ) 36 | * @abstract Additional methods for NSMutableAttributedString. 37 | */ 38 | @interface NSMutableAttributedString( GitHubUpdates ) 39 | 40 | /*! 41 | * @method processMarker:attributes: 42 | * @abstract Processes a marker, adding attributes if found. 43 | * @param marker The marker to process 44 | * @param attributes The attributes to use if the marker is found 45 | */ 46 | - ( void )processMarker: ( NSString * )marker attributes: ( NSDictionary * )attributes; 47 | 48 | /*! 49 | * @method processLineStart:attributes: 50 | * @abstract Processes a line start marker, adding attributes if found. 51 | * @param lineStart The line start marker 52 | * @param attributes The attributes to use if the line start marker is found 53 | */ 54 | - ( void )processLineStart: ( NSString * )lineStart attributes: ( NSDictionary * )attributes; 55 | 56 | @end 57 | 58 | NS_ASSUME_NONNULL_END 59 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSTextButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSTextButton.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSTextButton.h" 10 | 11 | @interface NYSTextButton () 12 | 13 | @property (nonatomic, strong) NSColor *normalColor; 14 | 15 | @property (nonatomic, strong) NSColor *hoverColor; 16 | 17 | @property (nonatomic, strong) NSTrackingArea *trackingArea; 18 | 19 | - (void)setTextColor:(NSColor *)color; 20 | 21 | @end 22 | 23 | @implementation NYSTextButton 24 | 25 | @synthesize fontSize = _fontSize; 26 | 27 | - (void)drawRect:(NSRect)dirtyRect { 28 | [super drawRect:dirtyRect]; 29 | 30 | // Drawing code here. 31 | } 32 | 33 | - (instancetype)initWithFrame:(NSRect)frameRect { 34 | self = [super initWithFrame:frameRect]; 35 | [self setButtonType:NSButtonTypeMomentaryChange]; 36 | [self setAlignment:NSTextAlignmentLeft]; 37 | [self setBordered:NO]; 38 | [self setImage:nil]; 39 | _fontSize = 12; 40 | return self; 41 | } 42 | 43 | - (void)updateTrackingAreas { 44 | if (self.trackingArea != nil) { 45 | [self removeTrackingArea:self.trackingArea]; 46 | } 47 | int ops = (NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways); 48 | self.trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] 49 | options:ops 50 | owner:self 51 | userInfo:nil]; 52 | [self addTrackingArea:self.trackingArea]; 53 | } 54 | 55 | - (void)mouseEntered:(NSEvent *)theEvent { 56 | [super mouseEntered:theEvent]; 57 | [self setMouseEntered]; 58 | } 59 | 60 | - (void)setMouseEntered { 61 | [self setTextColor:_hoverColor]; 62 | } 63 | 64 | - (void)mouseExited:(NSEvent *)theEvent { 65 | [super mouseExited:theEvent]; 66 | [self setMouseExited]; 67 | } 68 | 69 | - (void)setMouseExited { 70 | [self setTextColor:_normalColor]; 71 | } 72 | 73 | - (void)setTitle:(NSString *)title 74 | withNormalColor:(NSColor *)normal 75 | hoverColor:(NSColor *)hover { 76 | [super setTitle:title]; 77 | _normalColor = normal; 78 | _hoverColor = hover; 79 | [self setTextColor:normal]; 80 | } 81 | 82 | - (void)setTextColor:(NSColor *)color { 83 | NSMutableAttributedString *textAttr = [[NSMutableAttributedString alloc] initWithAttributedString:[self attributedTitle]]; 84 | NSRange titleRange = NSMakeRange(0, [self.title length]); 85 | [textAttr addAttribute:NSForegroundColorAttributeName value:color range:titleRange]; 86 | NSDictionary * attributes = [NSDictionary dictionaryWithObject:[NSFont systemFontOfSize:_fontSize] forKey:NSFontAttributeName]; 87 | [textAttr addAttributes:attributes range:titleRange]; 88 | [self setAttributedTitle:textAttr]; 89 | } 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Navigation/NYSNavigateVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNavigateVC.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSNavigateVC.h" 10 | #include "NYSNavigateItemVC.h" 11 | #include "NSColor+RGBValue.h" 12 | 13 | @interface NYSNavigateVC () 14 | 15 | @property (nonatomic, strong) NYSNavigateItemVC *projectImportItemVC; 16 | 17 | @property (nonatomic, strong) NYSNavigateItemVC *modificationItemVC; 18 | 19 | @property (nonatomic, strong) NYSNavigateItemVC *mixConfigItemVC; 20 | 21 | @property (nonatomic, strong) NYSNavigateItemVC *actionItemVC; 22 | 23 | @end 24 | 25 | @implementation NYSNavigateVC 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | // Do view setup here. 30 | 31 | _projectImportItemVC = [[NYSNavigateItemVC alloc] init]; 32 | [_projectImportItemVC setImageAndTitle:@"Project Import" withIcon:@"icon_nav_normal_import" isAutoFit:YES index:0 viewRect:NSMakeRect(0, 0 * ItemHeight, 168, ItemHeight)]; 33 | [_projectImportItemVC setBkColor:[NSColor colorWithRGBInt:SelectBackgroundColor]]; 34 | [_projectImportItemVC setDelegate:self]; 35 | [self addChildViewController:_projectImportItemVC]; 36 | [self.view addSubview:_projectImportItemVC.view]; 37 | 38 | _modificationItemVC = [[NYSNavigateItemVC alloc] init]; 39 | [_modificationItemVC setImageAndTitle:@"modify Config" withIcon:@"icon_nav_normal_modify" isAutoFit:YES index:1 viewRect:NSMakeRect(0, 1 * ItemHeight, 168, ItemHeight)]; 40 | [_modificationItemVC setBkColor:[NSColor colorWithRGBInt:0xffffff]]; 41 | [_modificationItemVC setDelegate:self]; 42 | [self addChildViewController:_modificationItemVC]; 43 | [self.view addSubview:_modificationItemVC.view]; 44 | 45 | _mixConfigItemVC = [[NYSNavigateItemVC alloc] init]; 46 | [_mixConfigItemVC setImageAndTitle:@"Replace Config" withIcon:@"icon_nav_normal_mix" isAutoFit:YES index:2 viewRect:NSMakeRect(0, 2 * ItemHeight, 168, ItemHeight)]; 47 | [_mixConfigItemVC setBkColor:[NSColor colorWithRGBInt:0xffffff]]; 48 | [_mixConfigItemVC setDelegate:self]; 49 | [self addChildViewController:_mixConfigItemVC]; 50 | [self.view addSubview:_mixConfigItemVC.view]; 51 | 52 | _actionItemVC = [[NYSNavigateItemVC alloc] init]; 53 | [_actionItemVC setImageAndTitle:@"Action" withIcon:@"icon_nav_normal_action" isAutoFit:YES index:3 viewRect:NSMakeRect(0, 3 * ItemHeight, 168, ItemHeight)]; 54 | [_actionItemVC setBkColor:[NSColor colorWithRGBInt:0xffffff]]; 55 | [_actionItemVC setDelegate:self]; 56 | [self addChildViewController:_actionItemVC]; 57 | [self.view addSubview:_actionItemVC.view]; 58 | } 59 | 60 | - (void)navigateItemOnclicked:(NSInteger)index { 61 | [[NSNotificationCenter defaultCenter] postNotificationName:ChangeNavNotice object:nil userInfo:@{@"target": [NSNumber numberWithInteger:index]}]; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Navigation/NYSNavigateItemVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSNavigateItemVC.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSNavigateItemVC.h" 10 | #import "NYSTextButton.h" 11 | #import "NYSImageButton.h" 12 | #import "NYSNavigateItem.h" 13 | 14 | @interface NYSNavigateItemVC () 15 | 16 | @property (nonatomic, strong) NYSNavigateItem *navigateItem; 17 | 18 | @property (nonatomic, strong) NYSTextButton *textButton; 19 | 20 | @property (nonatomic, strong) NYSImageButton *imageButton; 21 | 22 | @property (nonatomic, strong) NSString *titleValue; 23 | 24 | @property (nonatomic, strong) NSString *normalIcon; 25 | 26 | @property (nonatomic, strong) NSString *hoverIcon; 27 | 28 | @property (nonatomic) NSRect viewRect; 29 | 30 | @property (nonatomic, strong) NSColor *bkColor; 31 | 32 | @property (nonatomic, assign) BOOL isAutoFit; 33 | 34 | @property (nonatomic, assign) NSInteger index; 35 | 36 | @end 37 | 38 | @implementation NYSNavigateItemVC 39 | 40 | - (void)setImageAndTitle:(NSString *)title withIcon:(NSString *)normal isAutoFit:(BOOL)isAutoFit index:(NSInteger)index viewRect:(NSRect)rect { 41 | _index = index; 42 | _titleValue = title; 43 | _normalIcon = normal; 44 | _isAutoFit = isAutoFit; 45 | _viewRect = rect; 46 | } 47 | 48 | - (void)setImageAndTitle:(NSString*)title withNormalIcon:(NSString*)normal hoverIcon:(NSString*)hover index:(NSInteger)index viewRect:(NSRect)rect { 49 | _index = index; 50 | _titleValue = title; 51 | _normalIcon = normal; 52 | _hoverIcon = hover; 53 | _viewRect = rect; 54 | } 55 | 56 | - (void)setBkColor:(NSColor *)color { 57 | _bkColor = color; 58 | } 59 | 60 | - (void)viewDidLoad { 61 | [super viewDidLoad]; 62 | // Do view setup here. 63 | _imageButton = [[NYSImageButton alloc] initWithFrame:NSMakeRect(0, 0, 50, ItemHeight)]; 64 | if (_isAutoFit) { 65 | [_imageButton setImage:_normalIcon isAutoFit:YES]; 66 | } else { 67 | [_imageButton setImage:_normalIcon withHover:_hoverIcon]; 68 | } 69 | [self.view addSubview:_imageButton]; 70 | 71 | _textButton = [[NYSTextButton alloc] initWithFrame:NSMakeRect(50, 0, 122, ItemHeight)]; 72 | [_textButton setFontSize:14]; 73 | [_textButton setTitle:_titleValue withNormalColor:[NSColor colorWithRGBInt:MainFontColor] hoverColor:[NSColor colorWithRGBInt:ThemeColor]]; 74 | [_textButton setTag:_index]; 75 | [_textButton setTarget:self]; 76 | [_textButton setAction:@selector(buttonOnClicked:)]; 77 | [self.view addSubview:_textButton]; 78 | } 79 | 80 | - (void)loadView { 81 | _navigateItem = [[NYSNavigateItem alloc] initWithFrame:_viewRect]; 82 | [_navigateItem setBkColor:_bkColor]; 83 | self.view = _navigateItem; 84 | } 85 | 86 | - (void)buttonOnClicked:(NSButton *)sender { 87 | if (_delegate && [_delegate respondsToSelector:@selector(navigateItemOnclicked:)]) { 88 | [_delegate navigateItemOnclicked:_index]; 89 | } 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/NYSUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSUtils.m 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/22. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import "NYSUtils.h" 10 | 11 | @implementation NYSUtils 12 | 13 | + (void)showAlertPanel:(NSString *)info forWindow:(NSWindow *)window completionHandler:(void (^ _Nullable)(NSModalResponse returnCode))handler { 14 | NSAlert *alert = [[NSAlert alloc] init]; 15 | [alert addButtonWithTitle:@"I know"]; 16 | [alert setMessageText:@"Warning"]; 17 | [alert setInformativeText:info]; 18 | [alert setAlertStyle:NSAlertStyleCritical]; 19 | [alert beginSheetModalForWindow:window completionHandler:handler]; 20 | } 21 | 22 | + (NSImage *)changeImage:(NSImage *)aImage WithTintColor:(NSColor *)tintColor { 23 | if (aImage.isTemplate) { 24 | return aImage; 25 | } 26 | 27 | NSImage *image = aImage.copy; 28 | [image lockFocus]; 29 | [tintColor set]; 30 | 31 | NSRect imageRect = NSMakeRect(0, 0, image.size.width, image.size.height); 32 | NSRectFillUsingOperation(imageRect, NSCompositingOperationSourceAtop); 33 | 34 | [image unlockFocus]; 35 | [image setTemplate:false]; 36 | 37 | return image; 38 | } 39 | 40 | + (BOOL)blankString:(NSString *)string { 41 | if (![string isKindOfClass:[NSString class]]) { 42 | return YES; 43 | } 44 | if ([string isEqual:[NSNull null]]) { 45 | return YES; 46 | } 47 | if (string == NULL || [string isEqual:nil] || [string isEqual:Nil] || string == nil) { 48 | return YES; 49 | } 50 | if ([string isEqualToString:@"(null)"]) { 51 | return YES; 52 | } 53 | if ([string isEqualToString:@""]) { 54 | return YES; 55 | } 56 | if (string.length == 0 || [[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] == 0) { 57 | return YES; 58 | } 59 | return NO; 60 | } 61 | 62 | /// 生成首字母大写的指定长度随机字符串 63 | + (NSString *)generateRandomString:(int)lenght { 64 | NSString *sourceStr = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 65 | NSMutableString *resultStr = [[NSMutableString alloc] init]; 66 | for (int i = 0; i < lenght; i++) { 67 | unsigned index = rand() % [sourceStr length]; 68 | NSString *oneStr = [sourceStr substringWithRange:NSMakeRange(index, 1)]; 69 | while (([sourceStr characterAtIndex:index] > 96) && ([sourceStr characterAtIndex:index] < 123) && (i==0)) { 70 | index = rand() % [sourceStr length]; 71 | oneStr = [sourceStr substringWithRange:NSMakeRange(index, 1)]; 72 | } 73 | [resultStr appendString:oneStr]; 74 | } 75 | return resultStr; 76 | } 77 | 78 | /// 提取字符串中的大写字母 79 | + (NSString *)getCapitalString:(NSString *)str { 80 | NSInteger alength = [str length]; 81 | NSMutableString *resultStr = [[NSMutableString alloc] init]; 82 | for (int i = 0; i64) && (commitChar<91)) { 85 | [resultStr appendString:[str substringWithRange:NSMakeRange(i, 1)]]; 86 | } 87 | } 88 | if (resultStr.length == 0) { 89 | [resultStr appendString:@"ER"]; 90 | } 91 | return resultStr; 92 | } 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Headers/GitHubInstallWindowController.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header GitHubInstallWindowController.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | 32 | @class GitHubRelease; 33 | @class GitHubReleaseAsset; 34 | 35 | NS_ASSUME_NONNULL_BEGIN 36 | 37 | /*! 38 | * @class GitHubInstallWindowController 39 | * @abstract Window controller for the install window. 40 | * @discussion This window controller is used when an update is found, to 41 | * propose the user to install it. 42 | */ 43 | @interface GitHubInstallWindowController: NSWindowController 44 | 45 | /*! 46 | * @property asset 47 | * @abstract The asset proposed to be installed. 48 | * @see GitHubReleaseAsset 49 | */ 50 | @property( atomic, readonly, strong, nullable ) GitHubReleaseAsset * asset; 51 | 52 | /*! 53 | * @property githubRelease 54 | * @abstract The release proposed to be installed . 55 | * @see GitHubRelease 56 | */ 57 | @property( atomic, readonly, strong, nullable ) GitHubRelease * githubRelease; 58 | 59 | /*! 60 | * @property installingUpdate 61 | * @abstract Whether an update is currently beeing installed. 62 | */ 63 | @property( atomic, readonly ) BOOL installingUpdate; 64 | 65 | /*! 66 | * @method initWithAsset:release: 67 | * @abstract Initializes an instance with an asset and a release. 68 | * @discussion Although not marked as so, this method acts as the class' 69 | * designated initializer. 70 | * @param asset The proposed asset 71 | * @param release The proposed release 72 | * @result The initialized instance 73 | * @see GitHubReleaseAsset 74 | * @see GitHubRelease 75 | */ 76 | - ( instancetype )initWithAsset: ( GitHubReleaseAsset * )asset release: ( GitHubRelease * )release; 77 | 78 | @end 79 | 80 | NS_ASSUME_NONNULL_END 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![(logo)](https://github.com/niyongsheng/EasyRelease/blob/main/logo.png?raw=true&width=100&height=100) 2 | EasyRelease 3 | === 4 | [![](https://img.shields.io/badge/platform-Mac-orange.svg)](https://developer.apple.com/mac/) 5 | [![](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/niyongsheng/EasyRelease/blob/master/LICENSE) 6 | === 7 | 8 | ## Introduction 9 | > SaaS场景下自动化混淆工具。
10 | > Automated obfuscation tools in SaaS scenarios. 11 | 12 | ## Features 13 | - [x] Auto Configuration 14 | - [x] Rename Project 15 | - [x] Delete Annotation 16 | - [x] Rehash Images 17 | - [x] Replace Class/Method 18 | - [ ] Code Mix 19 | 20 | ## Screenshot 21 | ![image](https://github.com/niyongsheng/niyongsheng.github.io/blob/master/Document/easy_release_demo.gif?raw=true) 22 | 23 | ## Imagemagick 24 | ```shell 25 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 26 | 27 | brew install imagemagick 28 | ``` 29 | 30 | ## CocoaPods 31 | ```shell 32 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 33 | 34 | brew install cocoapods 35 | ``` 36 | ## Usage 37 | 38 | ### NTOCC project usage: 39 | >1. [Download](https://github.com/niyongsheng/EasyRelease/releases) configuration file `NtoccShipper.json` or `NtoccDriver.json` put that `.xcodeproj` in the same directory; 40 | >2. Import the configuration file under `EasyRelease` and enter the new project name; 41 | >3. Click `Action` button; 42 | 43 | ```json 44 | { 45 | "isSasS": false, 46 | "isAuto": false, 47 | "isAutoPodInstall": false, 48 | "isRehashImages": false, 49 | "isDelAnnotation": true, 50 | "replaceArray": [ 51 | { 52 | "Type": "class", 53 | "OldPrefix": "NYS", 54 | "NewPrefix": "NYSC", 55 | "Enable": "1" 56 | }, 57 | { 58 | "Type": "method", 59 | "OldPrefix": "NYS", 60 | "NewPrefix": "NYSM", 61 | "Enable": "0" 62 | } 63 | ], 64 | "projectFileDirUrl": "file:\/\/\/Users\/niyongsheng\/Desktop\/EasyRelease\/EasyRelease.xcodeproj", 65 | "projectDirUrl": "file:\/\/\/Users\/niyongsheng\/Desktop\/EasyRelease\/EasyRelease\/", 66 | "ignoreArray": [ 67 | { 68 | "name": "Pods", 69 | "enable": "1" 70 | } 71 | ], 72 | "projectOldName": "EasyRelease", 73 | "projectNewName": "EasyReleaseNew", 74 | "version": "1.0", 75 | "desc": "https://github.com/niyongsheng/EasyRelease" 76 | } 77 | ``` 78 | ### Field about .json 79 | ` "isSasS": false` Manual mode - read from configuration file; 80 | 81 | `"isSasS": true` automatic mode - name `.json` with the `.xcodeproj` filename;
82 | `"isSasS": true && "isAuto": false` Semi-automatic mode - need to specify a new project name, prefix is automatically extracted;
83 | `"isSasS": true && "isAuto": true` Full auto mode - new item names are randomly generated, prefix is automatically extracted; 84 | 85 | ## Remind 86 | `macOS 10.15+ ` 87 | 88 | ## Contribution 89 | Reward[:lollipop:](https://github.com/niyongsheng/niyongsheng.github.io/blob/master/Beg/README.md) Encourage[:heart:](https://github.com/niyongsheng/EasyRelease/stargazers) 90 | 91 | ## Contact Me [:octocat:](https://niyongsheng.github.io) 92 | * E-mail: niyongsheng@Outlook.com 93 | * Weibo: [@Ni永胜](https://weibo.com/u/7317805089) 94 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSContentVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSContentVC.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSContentVC.h" 10 | 11 | #import "NYSProjectImportVC.h" 12 | #import "NYSModificationVC.h" 13 | #import "NYSReplaceConfigVC.h" 14 | #import "NYSActionVC.h" 15 | 16 | #define MARGIN_SPACE 16 17 | 18 | @interface NYSContentVC () 19 | 20 | @property (nonatomic, strong) NSViewController *currentVC; 21 | 22 | @property (nonatomic, strong) NYSProjectImportVC *projectImportVC; 23 | @property (nonatomic, strong) NYSModificationVC *modification; 24 | @property (nonatomic, strong) NYSReplaceConfigVC *replaceConfigVC; 25 | @property (nonatomic, strong) NYSActionVC *actionVC; 26 | @end 27 | 28 | @implementation NYSContentVC 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | // Do view setup here. 33 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ChangeNavigationTargetNotificationHandler:) name:ChangeNavNotice object:nil]; 34 | 35 | _projectImportVC = [[NYSProjectImportVC alloc] initWithFrame:NSMakeRect(MARGIN_SPACE/2, MARGIN_SPACE/2, self.view.frame.size.width - MARGIN_SPACE, self.view.frame.size.height - MARGIN_SPACE)]; 36 | [self addChildViewController:_projectImportVC]; 37 | [self.view addSubview:_projectImportVC.view]; 38 | self.currentVC = _projectImportVC; 39 | 40 | _modification = [[NYSModificationVC alloc] initWithFrame:NSMakeRect(MARGIN_SPACE/2, MARGIN_SPACE/2, self.view.frame.size.width - MARGIN_SPACE, self.view.frame.size.height - MARGIN_SPACE)]; 41 | [self addChildViewController:_modification]; 42 | 43 | _replaceConfigVC = [[NYSReplaceConfigVC alloc] initWithFrame:NSMakeRect(MARGIN_SPACE/2, MARGIN_SPACE/2, self.view.frame.size.width - MARGIN_SPACE, self.view.frame.size.height - MARGIN_SPACE)]; 44 | [self addChildViewController:_replaceConfigVC]; 45 | 46 | _actionVC = [[NYSActionVC alloc] initWithFrame:NSMakeRect(MARGIN_SPACE/2, MARGIN_SPACE/2, self.view.frame.size.width - MARGIN_SPACE, self.view.frame.size.height - MARGIN_SPACE)]; 47 | [self addChildViewController:_actionVC]; 48 | } 49 | 50 | - (void)ChangeNavigationTargetNotificationHandler:(NSNotification*)notification { 51 | NSNumber *indexNumber = (NSNumber *)notification.userInfo[@"target"]; 52 | NSLog(@"on clicked page %ld", indexNumber.integerValue); 53 | 54 | switch (indexNumber.intValue) { 55 | case 0: 56 | [self replaceController:_projectImportVC]; 57 | break; 58 | 59 | case 1: 60 | [self replaceController:_modification]; 61 | break; 62 | 63 | case 2: 64 | [self replaceController:_replaceConfigVC]; 65 | break; 66 | 67 | case 3: 68 | [self replaceController:_actionVC]; 69 | break; 70 | 71 | default: 72 | break; 73 | } 74 | } 75 | 76 | - (void)replaceController:(NSViewController *)newController { 77 | [self transitionFromViewController:self.currentVC toViewController:newController options:NSViewControllerTransitionSlideDown completionHandler:nil]; 78 | self.currentVC = newController; 79 | } 80 | 81 | - (void)dealloc { 82 | [[NSNotificationCenter defaultCenter] removeObserver:self name:ChangeNavNotice object:nil]; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Headers/GitHubReleaseAsset.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header GitHubReleaseAsset.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | 32 | @class GitHubRelease; 33 | 34 | NS_ASSUME_NONNULL_BEGIN 35 | 36 | /*! 37 | * @class GitHubRelease 38 | * @abstract Represents a GitHub release's asset. 39 | */ 40 | @interface GitHubReleaseAsset: NSObject 41 | 42 | /*! 43 | * @property url 44 | * @abstract The asset's URL. 45 | * @discussion This URL corresponds to the asset API feed URL. 46 | * @see downloadURL 47 | */ 48 | @property( atomic, readonly, strong, nullable ) NSURL * url; 49 | 50 | /*! 51 | * @property downloadURL 52 | * @abstract The asset's download URL. 53 | */ 54 | @property( atomic, readonly, strong, nullable ) NSURL * downloadURL; 55 | 56 | /*! 57 | * @property name 58 | * @abstract The asset's name. 59 | */ 60 | @property( atomic, readonly, strong, nullable ) NSString * name; 61 | 62 | /*! 63 | * @property contentType 64 | * @abstract The asset's content type. 65 | */ 66 | @property( atomic, readonly, strong, nullable ) NSString * contentType; 67 | 68 | /*! 69 | * @property created 70 | * @abstract The asset's creation date. 71 | */ 72 | @property( atomic, readonly, strong, nullable ) NSDate * created; 73 | 74 | /*! 75 | * @property updated 76 | * @abstract The asset's update date, if any. 77 | */ 78 | @property( atomic, readonly, strong, nullable ) NSDate * updated; 79 | 80 | /*! 81 | * @property size 82 | * @abstract The asset's size. 83 | */ 84 | @property( atomic, readonly ) NSUInteger size; 85 | 86 | /*! 87 | * @method initWithDictionary: 88 | * @abstract Initializes an instance with properties from a dictionary. 89 | * @param dict The dictionary containing the asset's properties 90 | * @result The initialized instance, or nil 91 | */ 92 | - ( nullable instancetype )initWithDictionary: ( NSDictionary * )dict; 93 | 94 | @end 95 | 96 | NS_ASSUME_NONNULL_END 97 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Headers/GitHubProgressWindowController.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header GitHubUpdaterProgressWindowController.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | 32 | NS_ASSUME_NONNULL_BEGIN 33 | 34 | /*! 35 | * @class GitHubProgressWindowController 36 | * @abstract Window controller for the progress window. 37 | * @discussion This window controller is used for all progress activity, 38 | * checing for updates or installing an update. 39 | */ 40 | @interface GitHubProgressWindowController: NSWindowController 41 | 42 | /*! 43 | * @property title 44 | * @abstract The progress title message. 45 | */ 46 | @property( atomic, readwrite, strong, nullable ) NSString * title; 47 | 48 | /*! 49 | * @property message 50 | * @abstract The progress message. 51 | */ 52 | @property( atomic, readwrite, strong, nullable ) NSString * message; 53 | 54 | /*! 55 | * @property indeterminate 56 | * @abstract Whether the progress is indeterminate. 57 | * @disucssion This is used for the progress bar. 58 | */ 59 | @property( atomic, readwrite, assign ) BOOL indeterminate; 60 | 61 | /*! 62 | * @property progress 63 | * @abstract The current progress. 64 | * @disucssion This is used for the progress bar. 65 | */ 66 | @property( atomic, readwrite, assign ) double progress; 67 | 68 | /*! 69 | * @property progressMin 70 | * @abstract The progress minimum value 71 | * @disucssion This is used for the progress bar. 72 | */ 73 | @property( atomic, readwrite, assign ) double progressMin; 74 | 75 | /*! 76 | * @property progressMax 77 | * @abstract The progress maximum value 78 | * @disucssion This is used for the progress bar. 79 | */ 80 | @property( atomic, readwrite, assign ) double progressMax; 81 | 82 | /*! 83 | * @property cancel 84 | * @abstract A block invoked when the user presses the cancel button. 85 | * @discussion If nil, the cancel button will not be shown. 86 | */ 87 | @property( atomic, readwrite, strong, nullable ) void ( ^ cancel )( void ); 88 | 89 | @end 90 | 91 | NS_ASSUME_NONNULL_END 92 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Headers/GitHubUpdater.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header GitHubUpdater.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | #import 32 | 33 | NS_ASSUME_NONNULL_BEGIN 34 | 35 | /*! 36 | * @class GitHubUpdater 37 | * @abstract GitHub updater class. 38 | * @discussion This is the class you'll need to create in order to check for 39 | * GitHub updates. 40 | * Note that this class can be instanciated using InterfaceBuilder 41 | * as well. 42 | */ 43 | @interface GitHubUpdater: NSObject 44 | 45 | /*! 46 | * @property user 47 | * @abstract Your GitHub user name. 48 | */ 49 | @property( atomic, readwrite, strong ) IBInspectable NSString * user; 50 | 51 | /*! 52 | * @property repository 53 | * @abstract Your GitHub repository. 54 | */ 55 | @property( atomic, readwrite, strong ) IBInspectable NSString * repository; 56 | 57 | /*! 58 | * @property delegate 59 | * @abstract The delegate object, if you need behaviour customization. 60 | * @see GitHubUpdaterDelegate 61 | */ 62 | @property( atomic, readwrite, weak ) id< GitHubUpdaterDelegate > delegate; 63 | 64 | /*! 65 | * @property checkingForUpdates 66 | * @abstract Whether the updater is currently checking for updates. 67 | */ 68 | @property( atomic, readonly ) BOOL checkingForUpdates; 69 | 70 | /*! 71 | * @property installingUpdate 72 | * @abstract Whether the updater is currently installing an update. 73 | */ 74 | @property( atomic, readonly ) BOOL installingUpdate; 75 | 76 | /*! 77 | * @method checkForUpdates: 78 | * @abstract Checks for updates. 79 | " @discussion This method will display a progress window while checking for 80 | * updates. 81 | * If an update is found, it will present the user with a window 82 | * proposing to install the new update. 83 | * @param sender An optional sender. Not used. 84 | */ 85 | - ( IBAction )checkForUpdates: ( nullable id )sender; 86 | 87 | /*! 88 | * @method checkForUpdatesInBackground 89 | * @abstract Checks for updates in background. 90 | " @discussion This method won't display any UI. 91 | * If an update is found, it will present the user with a window 92 | * proposing to install the new update. 93 | */ 94 | - ( void )checkForUpdatesInBackground; 95 | 96 | @end 97 | 98 | NS_ASSUME_NONNULL_END 99 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/MainWindow.xib: -------------------------------------------------------------------------------- 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 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSImageTextButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSImageTextButton.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSImageTextButton.h" 10 | 11 | @interface NYSImageTextButton() 12 | 13 | @property (nonatomic, strong) NSImage *normalImage; 14 | 15 | @property (nonatomic, strong) NSImage *hoverImage; 16 | 17 | @property (nonatomic, strong) NSImage *disableImage; 18 | 19 | @property (nonatomic, strong) NSColor *normalColor; 20 | 21 | @property (nonatomic, strong) NSColor *hoverColor; 22 | 23 | @property (nonatomic, strong) NSColor *disableColor; 24 | 25 | @property (nonatomic, strong) NSColor *textColor; 26 | 27 | @property (nonatomic, strong) NSString *titleValue; 28 | 29 | @property (nonatomic, strong) NSTrackingArea *trackingArea; 30 | 31 | @end 32 | 33 | @implementation NYSImageTextButton 34 | 35 | @synthesize fontSize = _fontSize; 36 | 37 | - (void)drawRect:(NSRect)dirtyRect { 38 | [super drawRect:dirtyRect]; 39 | 40 | // Drawing code here. 41 | NSMutableParagraphStyle *style = 42 | [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; 43 | [style setLineBreakMode:NSLineBreakByWordWrapping]; 44 | [style setAlignment:NSTextAlignmentCenter]; 45 | NSDictionary *att = [[NSDictionary alloc] initWithObjectsAndKeys: 46 | style, NSParagraphStyleAttributeName, 47 | _textColor, 48 | NSForegroundColorAttributeName, nil]; 49 | [_titleValue drawInRect:NSMakeRect(self.bounds.origin.x+16, self.bounds.origin.y+7, self.bounds.size.width-16, self.bounds.size.height) withAttributes:att]; 50 | } 51 | 52 | - (instancetype)initWithFrame:(NSRect)frameRect { 53 | self = [super initWithFrame:frameRect]; 54 | [self setButtonType:NSButtonTypeMomentaryChange]; 55 | [self setBezelStyle:NSBezelStyleRoundedDisclosure]; 56 | [self setBordered:NO]; 57 | [self setImagePosition:NSImageOnly]; 58 | _fontSize = 12; 59 | _titleValue = @""; 60 | return self; 61 | } 62 | 63 | - (void)updateTrackingAreas { 64 | if (self.trackingArea != nil) { 65 | [self removeTrackingArea:self.trackingArea]; 66 | } 67 | int ops = (NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways); 68 | self.trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] 69 | options:ops 70 | owner:self 71 | userInfo:nil]; 72 | [self addTrackingArea:self.trackingArea]; 73 | } 74 | 75 | - (void)mouseEntered:(NSEvent *)theEvent { 76 | [super mouseEntered:theEvent]; 77 | [self setMouseEntered]; 78 | } 79 | 80 | - (void)setMouseEntered { 81 | if (self.isEnabled == FALSE) { 82 | _textColor = [NSColor colorWithRGBInt:0xe4e5e7]; 83 | self.image = _disableImage; 84 | return; 85 | } 86 | self.image = _hoverImage; 87 | _textColor = _hoverColor; 88 | } 89 | 90 | - (void)mouseExited:(NSEvent *)theEvent { 91 | [super mouseExited:theEvent]; 92 | [self setMouseExited]; 93 | } 94 | 95 | - (void)setMouseExited { 96 | if (self.isEnabled == FALSE) { 97 | _textColor = [NSColor colorWithRGBInt:0xe4e5e7]; 98 | self.image = _disableImage; 99 | return; 100 | } 101 | self.image = _normalImage; 102 | _textColor = _normalColor; 103 | } 104 | 105 | - (void)setImage:(NSString *)normal withHover:(NSString *)hover disable:(NSString *)disable { 106 | _normalImage = [NSImage imageNamed:normal]; 107 | _hoverImage = [NSImage imageNamed:hover]; 108 | _disableImage = [NSImage imageNamed:disable]; 109 | if (self.isEnabled == FALSE) { 110 | self.image = _disableImage; 111 | }else { 112 | self.image = _normalImage; 113 | } 114 | self.alternateImage = _hoverImage; 115 | } 116 | 117 | - (void)setTitle:(NSString *)title withNormalColor:(NSColor *)normal hoverColor:(NSColor *)hover disableColor:(NSColor *)disable { 118 | _titleValue = title; 119 | _normalColor = normal; 120 | _hoverColor = hover; 121 | _disableColor = disable; 122 | if (self.isEnabled == FALSE) { 123 | _textColor = _disableColor; 124 | }else { 125 | _textColor = _normalColor; 126 | } 127 | } 128 | 129 | @end 130 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/GitHubUpdates.framework/Versions/A/Headers/GitHubRelease.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2017 Jean-David Gadina - www.xs-labs.com 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | ******************************************************************************/ 24 | 25 | /*! 26 | * @header GitHubRelease.h 27 | * @copyright (c) 2017, Jean-David Gadina - www.xs-labs.com 28 | */ 29 | 30 | #import 31 | 32 | @class GitHubReleaseAsset; 33 | 34 | NS_ASSUME_NONNULL_BEGIN 35 | 36 | /*! 37 | * @class GitHubRelease 38 | * @abstract Represents a GitHub release. 39 | */ 40 | @interface GitHubRelease: NSObject 41 | 42 | /*! 43 | * @property url 44 | * @abstract The release URL. 45 | * @discussion This URL corresponds to the release API feed URL. 46 | * @see htmlURL 47 | */ 48 | @property( atomic, readonly, strong, nullable ) NSURL * url; 49 | 50 | /*! 51 | * @property htmlURL 52 | * @abstract The web URL for the release. 53 | */ 54 | @property( atomic, readonly, strong, nullable ) NSURL * htmlURL; 55 | 56 | /*! 57 | * @property tagName 58 | * @abstract The name of the release's tag. 59 | */ 60 | @property( atomic, readonly, strong, nullable ) NSString * tagName; 61 | 62 | /*! 63 | * @property draft 64 | * @abstract Whether this release is a draft. 65 | */ 66 | @property( atomic, readonly ) BOOL draft; 67 | 68 | /*! 69 | * @property draft 70 | * @abstract Whether this release is a prerelease. 71 | */ 72 | @property( atomic, readonly ) BOOL prerelease; 73 | 74 | /*! 75 | * @property created 76 | * @abstract The release's creation date. 77 | */ 78 | @property( atomic, readonly, strong, nullable ) NSDate * created; 79 | 80 | /*! 81 | * @property published 82 | * @abstract The release's publication date. 83 | */ 84 | @property( atomic, readonly, strong, nullable ) NSDate * published; 85 | 86 | /*! 87 | * @property tarballURL 88 | * @abstract The URL for the source code's TAR archive. 89 | */ 90 | @property( atomic, readonly, strong, nullable ) NSURL * tarballURL; 91 | 92 | /*! 93 | * @property zipballURL 94 | * @abstract The URL for the source code's ZIP archive. 95 | */ 96 | @property( atomic, readonly, strong, nullable ) NSURL * zipballURL; 97 | 98 | /*! 99 | * @property body 100 | * @abstract The release notes for the release. 101 | */ 102 | @property( atomic, readonly, strong, nullable ) NSString * body; 103 | 104 | /*! 105 | * @property assets 106 | * @abstract The assets contained in the release. 107 | * @see GitHubReleaseAsset 108 | */ 109 | @property( atomic, readonly, strong, nullable ) NSArray< GitHubReleaseAsset * > * assets; 110 | 111 | /*! 112 | * @method releasesWithData:error: 113 | * @abstract Gets an array of releases from JSON data. 114 | * @result The initialized instance 115 | * @param data The JSON data 116 | * @param error An optional pointer to an error object 117 | */ 118 | + ( nullable NSArray< GitHubRelease * > * )releasesWithData: ( NSData * )data error: ( NSError * __autoreleasing * )error; 119 | 120 | @end 121 | 122 | NS_ASSUME_NONNULL_END 123 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/TitleBar/NYSTitleBarVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSTitleBarVC.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSTitleBarVC.h" 10 | #import "NYSImageButton.h" 11 | #import "NYSTextButton.h" 12 | #import "NYSNoticeVC.h" 13 | #import "AppDelegate.h" 14 | 15 | @interface NYSTitleBarVC () 16 | 17 | @property (nonatomic, strong) NSImageView *logo; 18 | 19 | @property (nonatomic, strong) NSTextField *titleLabel; 20 | 21 | @property (nonatomic, strong) NYSImageButton *closeBtn; 22 | 23 | @property (nonatomic, strong) NYSImageButton *minBtn; 24 | 25 | @property (nonatomic, strong) NYSImageButton *settingBtn; 26 | 27 | @property (nonatomic, strong) NYSTextButton *feedbackBtn; 28 | 29 | @property (nonatomic, strong) NYSNoticeVC *noticeVC; 30 | 31 | @end 32 | 33 | @implementation NYSTitleBarVC 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | NSRect rect = [self.view bounds]; 38 | 39 | // Do view setup here. 40 | _logo = [[NSImageView alloc] initWithFrame:NSMakeRect(40, 15, 36, 36)]; 41 | [_logo setImage:[NSImage imageNamed:@"logo"]]; 42 | [_logo setTarget:self]; 43 | [self.view addSubview:_logo]; 44 | 45 | _titleLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(80, 15, 150, 40)]; 46 | _titleLabel.editable = NO; 47 | _titleLabel.bordered = NO; 48 | _titleLabel.stringValue = @"ER"; 49 | _titleLabel.backgroundColor = [NSColor clearColor]; 50 | _titleLabel.textColor = [NSColor whiteColor]; 51 | _titleLabel.font = [NSFont boldSystemFontOfSize:30]; 52 | _titleLabel.alignment = NSTextAlignmentLeft; 53 | [self.view addSubview:_titleLabel]; 54 | 55 | _noticeVC = [[NYSNoticeVC alloc] init]; 56 | [self addChildViewController:_noticeVC]; 57 | [self.view addSubview:_noticeVC.view]; 58 | 59 | _settingBtn = [[NYSImageButton alloc] initWithFrame:NSMakeRect(rect.size.width - 109, 22, 16, 16)]; 60 | [_settingBtn setImage:@"icon_setting" isAutoFit:NO]; 61 | [_settingBtn setTarget:self]; 62 | [_settingBtn setAction:@selector(settingBtnClicked:)]; 63 | [self.view addSubview:_settingBtn]; 64 | 65 | _minBtn = [[NYSImageButton alloc] initWithFrame:NSMakeRect(rect.size.width - 63, 22, 16, 16)]; 66 | [_minBtn setImage:@"icon_minimize" isAutoFit:NO]; 67 | [_minBtn setTarget:self]; 68 | [_minBtn setAction:@selector(minBtnClicked:)]; 69 | [self.view addSubview:_minBtn]; 70 | 71 | _closeBtn = [[NYSImageButton alloc] initWithFrame:NSMakeRect(rect.size.width - 34, 22, 16, 16)]; 72 | [_closeBtn setImage:@"icon_close" isAutoFit:NO]; 73 | [_closeBtn setTarget:self]; 74 | [_closeBtn setAction:@selector(closeBtnClicked:)]; 75 | [self.view addSubview:_closeBtn]; 76 | 77 | } 78 | 79 | - (void)closeBtnClicked:(id)sender { 80 | [self.view.window close]; 81 | } 82 | 83 | - (void)minBtnClicked:(id)sender { 84 | // [self.view.window miniaturize:self]; 85 | // [[NSApp mainWindow] miniaturize:nil]; 86 | [[NSApp mainWindow] performMiniaturize:sender]; 87 | } 88 | 89 | - (void)settingBtnClicked:(id)sender { 90 | NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 91 | NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; 92 | 93 | NSAlert *alert = [[NSAlert alloc] init]; 94 | [alert setIcon:[NSImage imageNamed:@"user_photo_default"]]; 95 | [alert addButtonWithTitle:@"Issues"]; 96 | [alert addButtonWithTitle:@"Update"]; 97 | [alert addButtonWithTitle:@"Cancel"]; 98 | [alert setMessageText:@"Your time may not be valuable but it is worth taking seriously."]; 99 | [alert setInformativeText:[@"Version:" stringByAppendingString:app_Version]]; 100 | [alert setAlertStyle:NSAlertStyleInformational]; 101 | [alert beginSheetModalForWindow:[self.view window] completionHandler:^(NSModalResponse returnCode) { 102 | if (returnCode == NSAlertFirstButtonReturn) { 103 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[ER_GH stringByAppendingString:@"/issues/new"]]]; 104 | } else if (returnCode == NSAlertSecondButtonReturn) { 105 | AppDelegate *delegate = [NSApplication sharedApplication].delegate; 106 | [delegate.updater checkForUpdates:nil]; 107 | } else { 108 | NSLog(@"onclicked cancel"); 109 | } 110 | }]; 111 | } 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/MainWindow/NYSPanelWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSImageButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSImageButton.m 3 | // EasyRelease 4 | // 5 | // Created by NYS on 21/02/05. 6 | // Copyright © 2021年 ER. All rights reserved. 7 | // 8 | 9 | #import "NYSImageButton.h" 10 | 11 | @interface NYSButtonCell : NSButtonCell 12 | 13 | - (NSRect)drawTitle:(NSAttributedString *)title withFrame:(NSRect)frame inView:(NSView *)controlView; 14 | 15 | @end 16 | 17 | @implementation NYSButtonCell 18 | 19 | - (NSRect)drawTitle:(NSAttributedString *)title withFrame:(NSRect)frame inView:(NSView *)controlView { 20 | if (![self isEnabled]) { 21 | return [super drawTitle:[self attributedTitle] withFrame:frame inView:controlView]; 22 | } 23 | return [super drawTitle:title withFrame:frame inView:controlView]; 24 | } 25 | 26 | @end 27 | 28 | @interface NYSImageButton () 29 | 30 | @property (nonatomic, strong) NSImage *normalImage; 31 | 32 | @property (nonatomic, strong) NSImage *hoverImage; 33 | 34 | @property (nonatomic, strong) NSImage *disabledImage; 35 | 36 | @property (nonatomic, strong) NSColor *normalColor; 37 | 38 | @property (nonatomic, strong) NSColor *hoverColor; 39 | 40 | @property (nonatomic, strong) NSTrackingArea *trackingArea; 41 | 42 | - (void)setTextColor:(NSColor *)color; 43 | 44 | @end 45 | 46 | @implementation NYSImageButton 47 | 48 | 49 | - (void)drawRect:(NSRect)dirtyRect { 50 | [super drawRect:dirtyRect]; 51 | 52 | // Drawing code here. 53 | } 54 | 55 | - (instancetype)initWithFrame:(NSRect)frameRect { 56 | self = [super initWithFrame:frameRect]; 57 | NYSButtonCell *cell = [[NYSButtonCell alloc] init]; 58 | [self setCell:cell]; 59 | [self setButtonType:NSButtonTypeMomentaryChange]; 60 | [self setBezelStyle:NSBezelStyleRoundedDisclosure]; 61 | [self setBordered:NO]; 62 | [[self cell] setImageDimsWhenDisabled:NO]; 63 | return self; 64 | } 65 | 66 | - (void)updateTrackingAreas { 67 | if (self.trackingArea != nil) { 68 | [self removeTrackingArea:self.trackingArea]; 69 | } 70 | int ops = (NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways); 71 | self.trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] 72 | options:ops 73 | owner:self 74 | userInfo:nil]; 75 | [self addTrackingArea:self.trackingArea]; 76 | } 77 | 78 | - (void)mouseEntered:(NSEvent *)theEvent { 79 | [super mouseEntered:theEvent]; 80 | [self setMouseEntered]; 81 | } 82 | 83 | - (void)setMouseEntered { 84 | if ([self isEnabled]) { 85 | self.image = _hoverImage; 86 | if (_hoverColor != nil) { 87 | [self setTextColor:_hoverColor]; 88 | } 89 | } 90 | } 91 | 92 | - (void)mouseExited:(NSEvent *)theEvent { 93 | [super mouseExited:theEvent]; 94 | [self setMouseExited]; 95 | } 96 | 97 | - (void)setMouseExited { 98 | if ([self isEnabled]) { 99 | self.image = _normalImage; 100 | if (_normalColor != nil) { 101 | [self setTextColor:_normalColor]; 102 | } 103 | } 104 | } 105 | 106 | - (void)setImage:(NSString *)normal withHover:(NSString *)hover { 107 | _normalImage = [NSImage imageNamed:normal]; 108 | _hoverImage = [NSImage imageNamed:hover]; 109 | self.image = _normalImage; 110 | self.alternateImage = _hoverImage; 111 | } 112 | 113 | - (void)setImage:(NSString *)normal isAutoFit:(BOOL)isAutoFit { 114 | if (isAutoFit) { 115 | _normalImage = [NYSUtils changeImage:[NSImage imageNamed:normal] WithTintColor:[NSColor lightGrayColor]]; 116 | _hoverImage = [NYSUtils changeImage:[NSImage imageNamed:normal] WithTintColor:[NSColor colorWithRGBInt:ThemeColor]]; 117 | } else { 118 | _normalImage = [NSImage imageNamed:normal]; 119 | _hoverImage = [NSImage imageNamed:normal]; 120 | } 121 | 122 | self.image = _normalImage; 123 | self.alternateImage = _hoverImage; 124 | } 125 | 126 | - (void)setImage:(NSString *)normal 127 | withHover:(NSString *)hover 128 | withDisabled:(NSString *)disabled { 129 | [self setImage:normal withHover:hover]; 130 | _disabledImage = [NSImage imageNamed:disabled]; 131 | } 132 | 133 | - (void)setTitle:(NSString *)title 134 | withNormalColor:(NSColor *)normal 135 | hoverColor:(NSColor *)hover { 136 | [super setTitle:title]; 137 | _normalColor = normal; 138 | _hoverColor = hover; 139 | [self setTextColor:normal]; 140 | } 141 | 142 | - (void)setTextColor:(NSColor *)color { 143 | NSMutableAttributedString *textAttr = [[NSMutableAttributedString alloc] initWithAttributedString:[self attributedTitle]]; 144 | NSRange titleRange = NSMakeRange(0, [self.title length]); 145 | [textAttr addAttribute:NSForegroundColorAttributeName value:color range:titleRange]; 146 | [self setAttributedTitle:textAttr]; 147 | } 148 | 149 | - (void)setEnabled:(BOOL)enabled { 150 | [super setEnabled:enabled]; 151 | if (!enabled) { 152 | self.image = _disabledImage; 153 | } 154 | } 155 | 156 | @end 157 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSModificationVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSModificationVC.m 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/19. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import "NYSModificationVC.h" 10 | 11 | @interface NYSModificationVC () 12 | @property (weak) IBOutlet NSTextField *nameOldTextField; 13 | @property (weak) IBOutlet NSTextField *nameNewTextField; 14 | @property (weak) IBOutlet NSSwitch *delAnnotationSwitch; 15 | @property (weak) IBOutlet NSSwitch *rehashImgSwitch; 16 | @property (weak) IBOutlet NSSwitch *podInstallSwitch; 17 | @end 18 | 19 | @implementation NYSModificationVC 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contextDidChange:) name:NSControlTextDidChangeNotification object:_nameOldTextField]; 25 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(contextDidChange:) name:NSControlTextDidChangeNotification object:_nameNewTextField]; 26 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(RefreshConfigUINotificationHandler:) name:RefreshConfNotice object:nil]; 27 | 28 | self.delAnnotationSwitch.layer.backgroundColor = [NSColor colorWithRGBInt:ThemeColor].CGColor; 29 | self.rehashImgSwitch.layer.backgroundColor = [NSColor colorWithRGBInt:ThemeColor].CGColor; 30 | } 31 | 32 | - (instancetype)initWithFrame:(NSRect)frameRect { 33 | if (self = [super initWithNibName:NSStringFromClass([self class]) bundle:nil]) { 34 | self.view.wantsLayer = YES; 35 | [self.view setFrame:frameRect]; 36 | [self.view.layer setBackgroundColor:[[NSColor clearColor] CGColor]]; 37 | } 38 | return self; 39 | } 40 | 41 | - (IBAction)delAnnotationSwitched:(NSSwitch *)sender { 42 | NConfig.isDelAnnotation = sender.state; 43 | } 44 | 45 | - (IBAction)rehashImgSwitched:(NSSwitch *)sender { 46 | if (sender.state == YES) { 47 | 48 | NSAlert *alert = [[NSAlert alloc] init]; 49 | [alert addButtonWithTitle:@"Installed"]; 50 | [alert addButtonWithTitle:@"Uninstall"]; 51 | [alert setIcon:[NSImage imageNamed:@"terminal"]]; 52 | [alert setMessageText:@"Install imagemagick"]; 53 | [alert setInformativeText:[ER_GH stringByAppendingString:@"/blob/master/README.md#Imagemagick"]]; 54 | [alert setAlertStyle:NSAlertStyleInformational]; 55 | [alert beginSheetModalForWindow:[self.view window] completionHandler:^(NSModalResponse returnCode) { 56 | if (returnCode == NSAlertFirstButtonReturn) { 57 | NConfig.isRehashImages = sender.state; 58 | } else if (returnCode == NSAlertSecondButtonReturn) { 59 | sender.state = NO; 60 | NSLog(@"onclicked uninstall"); 61 | } 62 | }]; 63 | } else { 64 | NConfig.isRehashImages = sender.state; 65 | } 66 | } 67 | 68 | - (IBAction)podInstallSwitched:(NSSwitch *)sender { 69 | if (sender.state == YES) { 70 | 71 | NSAlert *alert = [[NSAlert alloc] init]; 72 | [alert addButtonWithTitle:@"Installed"]; 73 | [alert addButtonWithTitle:@"Uninstall"]; 74 | [alert setIcon:[NSImage imageNamed:@"terminal"]]; 75 | [alert setMessageText:@"Install CocoaPods"]; 76 | [alert setInformativeText:[ER_GH stringByAppendingString:@"/blob/master/README.md#CocoaPods"]]; 77 | [alert setAlertStyle:NSAlertStyleInformational]; 78 | [alert beginSheetModalForWindow:[self.view window] completionHandler:^(NSModalResponse returnCode) { 79 | if (returnCode == NSAlertFirstButtonReturn) { 80 | NConfig.isAutoPodInstall = sender.state; 81 | } else if (returnCode == NSAlertSecondButtonReturn) { 82 | sender.state = NO; 83 | NSLog(@"onclicked uninstall"); 84 | } 85 | }]; 86 | } else { 87 | NConfig.isAutoPodInstall = sender.state; 88 | } 89 | } 90 | 91 | - (void)contextDidChange:(NSNotification *)notification { 92 | if (notification.object == _nameOldTextField) { 93 | if (_nameOldTextField.stringValue.length <= 0) { 94 | [ArtProgressHUD showInfoText:@"please input old project name"]; 95 | } 96 | NConfig.projectOldName = _nameOldTextField.stringValue; 97 | } else if (notification.object == _nameNewTextField) { 98 | if (_nameNewTextField.stringValue.length <= 0) { 99 | [ArtProgressHUD showInfoText:@"please input new project name"]; 100 | } 101 | NConfig.projectNewName = _nameNewTextField.stringValue; 102 | } 103 | } 104 | 105 | - (void)RefreshConfigUINotificationHandler:(NSNotification *)notification { 106 | self.delAnnotationSwitch.state = NConfig.isDelAnnotation; 107 | self.rehashImgSwitch.state = NConfig.isRehashImages; 108 | self.podInstallSwitch.state = NConfig.isAutoPodInstall; 109 | 110 | self.nameOldTextField.stringValue = NConfig.projectOldName; 111 | self.nameNewTextField.stringValue = NConfig.projectNewName; 112 | } 113 | 114 | - (void)dealloc { 115 | [[NSNotificationCenter defaultCenter] removeObserver:self name:RefreshConfNotice object:nil]; 116 | [[NSNotificationCenter defaultCenter] removeObserver:self name:NSControlTextDidChangeNotification object:nil]; 117 | } 118 | 119 | @end 120 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSProjectImportVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSProjectImportVC.m 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/19. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import "NYSProjectImportVC.h" 10 | 11 | #define IconName @"icon_ignore" 12 | 13 | @interface NYSProjectImportVC () 14 | < 15 | NSTableViewDelegate, 16 | NSTableViewDataSource 17 | > 18 | 19 | @property (weak) IBOutlet NSTextField *projectFileDirectory; 20 | @property (weak) IBOutlet NSTextField *projectDirectory; 21 | 22 | @property (weak) IBOutlet NSPathCell *pfdPathCell; 23 | 24 | @property (strong) IBOutlet NSTableView *tableView; 25 | 26 | @end 27 | 28 | @implementation NYSProjectImportVC 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | self.projectFileDirectory.editable = NO; 33 | self.projectDirectory.editable = NO; 34 | NConfig.ignoreArray = [NSMutableArray arrayWithArray:@[@{@"name": @"Pods", @"enable": @(true)}]]; 35 | self.tableView.delegate = self; 36 | self.tableView.dataSource = self; 37 | self.tableView.allowsMultipleSelection = NO; 38 | 39 | NSTableColumn *column = self.tableView.tableColumns[0]; 40 | NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey:column.identifier ascending:YES]; 41 | column.sortDescriptorPrototype = descriptor; 42 | 43 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(RefreshConfigUINotificationHandler:) name:RefreshConfNotice object:nil]; 44 | } 45 | 46 | - (instancetype)initWithFrame:(NSRect)frameRect { 47 | if (self = [super initWithNibName:NSStringFromClass([self class]) bundle:nil]) { 48 | self.view.wantsLayer = YES; 49 | [self.view setFrame:frameRect]; 50 | [self.view.layer setBackgroundColor:[[NSColor clearColor] CGColor]]; 51 | } 52 | return self; 53 | } 54 | 55 | - (IBAction)openProjectDirectoryButtonClick:(NSButton *)sender { 56 | NSOpenPanel *oPanel = [NSOpenPanel openPanel]; 57 | [oPanel setCanChooseDirectories:NO]; 58 | [oPanel setCanChooseFiles:YES]; 59 | [oPanel setAllowedFileTypes:@[@"xcodeproj"]]; 60 | // [oPanel setDirectoryURL:[NSURL URLWithString:NSHomeDirectory()]]; 61 | if ([oPanel runModal] == NSModalResponseOK) { 62 | NSURL *url = [[oPanel URLs] objectAtIndex:0]; 63 | NConfig.projectFileDirUrl = url; 64 | self.projectFileDirectory.stringValue = [url path]; 65 | NSLog(@"项目文件:%@", [url absoluteString]); 66 | } 67 | } 68 | 69 | - (IBAction)openDirectoryButtonClick:(NSButton *)sender { 70 | NSOpenPanel *oPanel = [NSOpenPanel openPanel]; 71 | [oPanel setCanChooseDirectories:YES]; 72 | [oPanel setCanChooseFiles:NO]; 73 | if ([oPanel runModal] == NSModalResponseOK) { 74 | NSURL *url = [[oPanel URLs] objectAtIndex:0]; 75 | NConfig.projectDirUrl = url; 76 | self.projectDirectory.stringValue = [url path]; 77 | NSLog(@"项目地址:%@", [url absoluteString]); 78 | } 79 | } 80 | 81 | - (IBAction)addItemOnclicked:(NSButton *)sender { 82 | NSOpenPanel *oPanel = [NSOpenPanel openPanel]; 83 | [oPanel setCanChooseDirectories:YES]; 84 | [oPanel setCanChooseFiles:NO]; 85 | if ([oPanel runModal] == NSModalResponseOK) { 86 | NSURL *url = [[oPanel URLs] objectAtIndex:0]; 87 | NSString *pathStr = [url path]; 88 | self.pfdPathCell.stringValue = pathStr; 89 | NSLog(@"忽略该文件夹下的文件:%@", pathStr); 90 | NSArray *pathArr = [pathStr componentsSeparatedByString:@"/"]; 91 | NSDictionary *dic = @{@"name": [pathArr lastObject], @"enable": @(true)}; 92 | [NConfig.ignoreArray addObject:dic]; 93 | [self.tableView reloadData]; 94 | } 95 | } 96 | 97 | - (IBAction)removeItemOnclicked:(NSButton *)sender { 98 | NSInteger row = self.tableView.selectedRow; 99 | if (row < 0) { 100 | [ArtProgressHUD showText:@"No available data"]; 101 | return; 102 | } 103 | [self.tableView removeRowsAtIndexes:[NSIndexSet indexSetWithIndex:row] withAnimation:NSTableViewAnimationEffectFade]; 104 | [NConfig.ignoreArray removeObjectAtIndex:row]; 105 | } 106 | 107 | #pragma mark - NSTableViewDelegate 108 | - (void)tableView:(NSTableView *)tableView didClickTableColumn:(NSTableColumn *)tableColumn { 109 | NSLog(@"点击%@ 列.", tableColumn.title); 110 | NSLog(@"----+---- %d", tableColumn.sortDescriptorPrototype.ascending); 111 | } 112 | 113 | #pragma mark - NSTableViewDataSource 114 | - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { 115 | return NConfig.ignoreArray.count; 116 | } 117 | 118 | - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { 119 | NSDictionary *rowInfoDic = NConfig.ignoreArray[row]; 120 | NSString *key = tableColumn.identifier; 121 | 122 | NSView *contentView = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self]; 123 | 124 | if ([key isEqualToString:@"Directory"]) { 125 | NSString *name = rowInfoDic[@"name"]; 126 | NSTextField *textField = [contentView subviews][0]; 127 | textField.stringValue = name; 128 | NSImageView *iconImageView = [contentView subviews][1]; 129 | iconImageView.image = [NYSUtils changeImage:[NSImage imageNamed:@"icon_ignore"] WithTintColor:[NSColor colorWithRGBInt:ThemeColor]]; 130 | } 131 | return contentView; 132 | } 133 | 134 | - (void)RefreshConfigUINotificationHandler:(NSNotification *)notification { 135 | self.projectFileDirectory.stringValue = NConfig.projectFileDirUrl.path; 136 | self.projectDirectory.stringValue = NConfig.projectDirUrl.path; 137 | 138 | [self.tableView reloadData]; 139 | } 140 | 141 | - (void)dealloc { 142 | [[NSNotificationCenter defaultCenter] removeObserver:self name:RefreshConfNotice object:nil]; 143 | } 144 | 145 | @end 146 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/View/Controller/NYSReplaceConfigVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // NYSReplaceConfigVC.m 3 | // EasyRelease 4 | // 5 | // Created by 倪永胜 on 2021/2/19. 6 | // Copyright © 2021 NYS. All rights reserved. 7 | // 8 | 9 | #import "NYSReplaceConfigVC.h" 10 | 11 | @interface NYSReplaceConfigVC () 12 | < 13 | NSTableViewDelegate, 14 | NSTableViewDataSource 15 | > 16 | 17 | @property (nonatomic, assign) NSInteger clickedRow; 18 | @property (strong) IBOutlet NSTableView *tableView; 19 | 20 | @property (weak) IBOutlet NSTextField *prefixOldTextField; 21 | @property (weak) IBOutlet NSTextField *prefixNewTextField; 22 | @property (weak) IBOutlet NSComboBox *typeBox; 23 | 24 | @end 25 | 26 | @implementation NYSReplaceConfigVC 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | 31 | NConfig.replaceArray = [NSMutableArray array]; 32 | self.tableView.delegate = self; 33 | self.tableView.dataSource = self; 34 | self.tableView.allowsMultipleSelection = NO; 35 | 36 | NSTableColumn *column = self.tableView.tableColumns[0]; 37 | NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey:column.identifier ascending:YES]; 38 | column.sortDescriptorPrototype = descriptor; 39 | 40 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(RefreshConfigUINotificationHandler:) name:RefreshConfNotice object:nil]; 41 | } 42 | 43 | - (instancetype)initWithFrame:(NSRect)frameRect { 44 | if (self = [super initWithNibName:NSStringFromClass([self class]) bundle:nil]) { 45 | self.view.wantsLayer = YES; 46 | [self.view setFrame:frameRect]; 47 | [self.view.layer setBackgroundColor:[[NSColor clearColor] CGColor]]; 48 | } 49 | return self; 50 | } 51 | 52 | - (IBAction)addRow:(NSButton *)sender { 53 | if (_prefixOldTextField.stringValue.length <= 0) { 54 | [NYSUtils showAlertPanel:@"please input old prefix" forWindow:self.view.window completionHandler:nil]; 55 | return; 56 | } 57 | if (_prefixNewTextField.stringValue.length <= 0) { 58 | [NYSUtils showAlertPanel:@"please input new prefix" forWindow:self.view.window completionHandler:nil]; 59 | return; 60 | } 61 | if (_typeBox.stringValue.length <= 0) { 62 | [NYSUtils showAlertPanel:@"please select type" forWindow:self.view.window completionHandler:nil]; 63 | return; 64 | } 65 | 66 | NSDictionary *dic = @{@"OldPrefix": _prefixOldTextField.stringValue, 67 | @"NewPrefix": _prefixNewTextField.stringValue, 68 | @"Type": _typeBox.stringValue, 69 | @"Enable": @(true)}; 70 | [NConfig.replaceArray addObject:dic]; 71 | [self.tableView reloadData]; 72 | if (NConfig.replaceArray.count > 0) { 73 | [self.tableView editColumn:0 row:NConfig.replaceArray.count - 1 withEvent:nil select:YES]; 74 | } 75 | } 76 | 77 | - (IBAction)removeRow:(NSButton *)sender { 78 | NSInteger row = self.tableView.selectedRow; 79 | if (row < 0) { 80 | [ArtProgressHUD showText:@"No available data"]; 81 | return; 82 | } 83 | [self.tableView removeRowsAtIndexes:[NSIndexSet indexSetWithIndex:row] withAnimation:NSTableViewAnimationEffectFade]; 84 | [NConfig.replaceArray removeObjectAtIndex:row]; 85 | } 86 | 87 | #pragma mark - NSTableViewDelegate 88 | - (void)tableView:(NSTableView *)tableView didClickTableColumn:(NSTableColumn *)tableColumn { 89 | NSLog(@"点击%@ 列.", tableColumn.title); 90 | NSLog(@"----+---- %d", tableColumn.sortDescriptorPrototype.ascending); 91 | } 92 | 93 | #pragma mark - NSTableViewDataSource 94 | - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { 95 | return NConfig.replaceArray.count; 96 | } 97 | 98 | - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { 99 | NSDictionary *rowInfoDic = NConfig.replaceArray[row]; 100 | NSString *key = tableColumn.identifier; 101 | id value = rowInfoDic[key]; 102 | 103 | NSView *contentView = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self]; 104 | if ([key isEqualToString:@"NewPrefix"]) { 105 | NSTextField *textField = [contentView subviews][0]; 106 | textField.stringValue = (NSString *)value; 107 | } else if ([key isEqualToString:@"OldPrefix"]) { 108 | NSTextField *textField = [contentView subviews][0]; 109 | textField.stringValue = (NSString *)value; 110 | } else if ([key isEqualToString:@"Type"]) { 111 | NSComboBox *comboBox = [contentView subviews][0]; 112 | comboBox.stringValue = (NSString *)value; 113 | 114 | [comboBox setTag:row]; 115 | [comboBox setAction:@selector(comboBoxChanged:)]; 116 | } else { 117 | NSButton *checkBoxButton = [contentView subviews][0]; 118 | [checkBoxButton setState:[(NSString *)value integerValue]]; 119 | 120 | [checkBoxButton setTag:row]; 121 | [checkBoxButton setAction:@selector(checkButtonClick:)]; 122 | } 123 | 124 | return contentView; 125 | } 126 | 127 | - (void)checkButtonClick:(NSButton *)sender { 128 | NSDictionary *rowInfoDic = NConfig.replaceArray[sender.tag]; 129 | NSMutableDictionary *mutableReplaceDict = [NSMutableDictionary dictionaryWithDictionary:rowInfoDic]; 130 | NSString *newValue = sender.state ? @"1" : @"0"; 131 | [mutableReplaceDict setValue:newValue forKey:@"Enable"]; 132 | NConfig.replaceArray[sender.tag] = mutableReplaceDict; 133 | [ArtProgressHUD showInfoText:@"updated"]; 134 | } 135 | 136 | - (void)comboBoxChanged:(NSComboBox *)sender { 137 | NSDictionary *rowInfoDic = NConfig.replaceArray[sender.tag]; 138 | NSMutableDictionary *mutableReplaceDict = [NSMutableDictionary dictionaryWithDictionary:rowInfoDic]; 139 | NSString *newValue = sender.stringValue; 140 | [mutableReplaceDict setValue:newValue forKey:@"Type"]; 141 | NConfig.replaceArray[sender.tag] = mutableReplaceDict; 142 | [ArtProgressHUD showInfoText:@"updated"]; 143 | } 144 | 145 | - (void)RefreshConfigUINotificationHandler:(NSNotification *)notification { 146 | [self.tableView reloadData]; 147 | } 148 | 149 | - (void)dealloc { 150 | [[NSNotificationCenter defaultCenter] removeObserver:self name:RefreshConfNotice object:nil]; 151 | } 152 | 153 | @end 154 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/ArtProgressHUD.xib: -------------------------------------------------------------------------------- 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 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/YYModel/YYClassInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYClassInfo.h 3 | // YYModel 4 | // 5 | // Created by ibireme on 15/5/9. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | #import 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | /** 18 | Type encoding's type. 19 | */ 20 | typedef NS_OPTIONS(NSUInteger, YYEncodingType) { 21 | YYEncodingTypeMask = 0xFF, ///< mask of type value 22 | YYEncodingTypeUnknown = 0, ///< unknown 23 | YYEncodingTypeVoid = 1, ///< void 24 | YYEncodingTypeBool = 2, ///< bool 25 | YYEncodingTypeInt8 = 3, ///< char / BOOL 26 | YYEncodingTypeUInt8 = 4, ///< unsigned char 27 | YYEncodingTypeInt16 = 5, ///< short 28 | YYEncodingTypeUInt16 = 6, ///< unsigned short 29 | YYEncodingTypeInt32 = 7, ///< int 30 | YYEncodingTypeUInt32 = 8, ///< unsigned int 31 | YYEncodingTypeInt64 = 9, ///< long long 32 | YYEncodingTypeUInt64 = 10, ///< unsigned long long 33 | YYEncodingTypeFloat = 11, ///< float 34 | YYEncodingTypeDouble = 12, ///< double 35 | YYEncodingTypeLongDouble = 13, ///< long double 36 | YYEncodingTypeObject = 14, ///< id 37 | YYEncodingTypeClass = 15, ///< Class 38 | YYEncodingTypeSEL = 16, ///< SEL 39 | YYEncodingTypeBlock = 17, ///< block 40 | YYEncodingTypePointer = 18, ///< void* 41 | YYEncodingTypeStruct = 19, ///< struct 42 | YYEncodingTypeUnion = 20, ///< union 43 | YYEncodingTypeCString = 21, ///< char* 44 | YYEncodingTypeCArray = 22, ///< char[10] (for example) 45 | 46 | YYEncodingTypeQualifierMask = 0xFF00, ///< mask of qualifier 47 | YYEncodingTypeQualifierConst = 1 << 8, ///< const 48 | YYEncodingTypeQualifierIn = 1 << 9, ///< in 49 | YYEncodingTypeQualifierInout = 1 << 10, ///< inout 50 | YYEncodingTypeQualifierOut = 1 << 11, ///< out 51 | YYEncodingTypeQualifierBycopy = 1 << 12, ///< bycopy 52 | YYEncodingTypeQualifierByref = 1 << 13, ///< byref 53 | YYEncodingTypeQualifierOneway = 1 << 14, ///< oneway 54 | 55 | YYEncodingTypePropertyMask = 0xFF0000, ///< mask of property 56 | YYEncodingTypePropertyReadonly = 1 << 16, ///< readonly 57 | YYEncodingTypePropertyCopy = 1 << 17, ///< copy 58 | YYEncodingTypePropertyRetain = 1 << 18, ///< retain 59 | YYEncodingTypePropertyNonatomic = 1 << 19, ///< nonatomic 60 | YYEncodingTypePropertyWeak = 1 << 20, ///< weak 61 | YYEncodingTypePropertyCustomGetter = 1 << 21, ///< getter= 62 | YYEncodingTypePropertyCustomSetter = 1 << 22, ///< setter= 63 | YYEncodingTypePropertyDynamic = 1 << 23, ///< @dynamic 64 | }; 65 | 66 | /** 67 | Get the type from a Type-Encoding string. 68 | 69 | @discussion See also: 70 | https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html 71 | https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtPropertyIntrospection.html 72 | 73 | @param typeEncoding A Type-Encoding string. 74 | @return The encoding type. 75 | */ 76 | YYEncodingType YYEncodingGetType(const char *typeEncoding); 77 | 78 | 79 | /** 80 | Instance variable information. 81 | */ 82 | @interface YYClassIvarInfo : NSObject 83 | @property (nonatomic, assign, readonly) Ivar ivar; ///< ivar opaque struct 84 | @property (nonatomic, strong, readonly) NSString *name; ///< Ivar's name 85 | @property (nonatomic, assign, readonly) ptrdiff_t offset; ///< Ivar's offset 86 | @property (nonatomic, strong, readonly) NSString *typeEncoding; ///< Ivar's type encoding 87 | @property (nonatomic, assign, readonly) YYEncodingType type; ///< Ivar's type 88 | 89 | /** 90 | Creates and returns an ivar info object. 91 | 92 | @param ivar ivar opaque struct 93 | @return A new object, or nil if an error occurs. 94 | */ 95 | - (instancetype)initWithIvar:(Ivar)ivar; 96 | @end 97 | 98 | 99 | /** 100 | Method information. 101 | */ 102 | @interface YYClassMethodInfo : NSObject 103 | @property (nonatomic, assign, readonly) Method method; ///< method opaque struct 104 | @property (nonatomic, strong, readonly) NSString *name; ///< method name 105 | @property (nonatomic, assign, readonly) SEL sel; ///< method's selector 106 | @property (nonatomic, assign, readonly) IMP imp; ///< method's implementation 107 | @property (nonatomic, strong, readonly) NSString *typeEncoding; ///< method's parameter and return types 108 | @property (nonatomic, strong, readonly) NSString *returnTypeEncoding; ///< return value's type 109 | @property (nullable, nonatomic, strong, readonly) NSArray *argumentTypeEncodings; ///< array of arguments' type 110 | 111 | /** 112 | Creates and returns a method info object. 113 | 114 | @param method method opaque struct 115 | @return A new object, or nil if an error occurs. 116 | */ 117 | - (instancetype)initWithMethod:(Method)method; 118 | @end 119 | 120 | 121 | /** 122 | Property information. 123 | */ 124 | @interface YYClassPropertyInfo : NSObject 125 | @property (nonatomic, assign, readonly) objc_property_t property; ///< property's opaque struct 126 | @property (nonatomic, strong, readonly) NSString *name; ///< property's name 127 | @property (nonatomic, assign, readonly) YYEncodingType type; ///< property's type 128 | @property (nonatomic, strong, readonly) NSString *typeEncoding; ///< property's encoding value 129 | @property (nonatomic, strong, readonly) NSString *ivarName; ///< property's ivar name 130 | @property (nullable, nonatomic, assign, readonly) Class cls; ///< may be nil 131 | @property (nullable, nonatomic, strong, readonly) NSArray *protocols; ///< may nil 132 | @property (nonatomic, assign, readonly) SEL getter; ///< getter (nonnull) 133 | @property (nonatomic, assign, readonly) SEL setter; ///< setter (nonnull) 134 | 135 | /** 136 | Creates and returns a property info object. 137 | 138 | @param property property opaque struct 139 | @return A new object, or nil if an error occurs. 140 | */ 141 | - (instancetype)initWithProperty:(objc_property_t)property; 142 | @end 143 | 144 | 145 | /** 146 | Class information for a class. 147 | */ 148 | @interface YYClassInfo : NSObject 149 | @property (nonatomic, assign, readonly) Class cls; ///< class object 150 | @property (nullable, nonatomic, assign, readonly) Class superCls; ///< super class object 151 | @property (nullable, nonatomic, assign, readonly) Class metaCls; ///< class's meta class object 152 | @property (nonatomic, readonly) BOOL isMeta; ///< whether this class is meta class 153 | @property (nonatomic, strong, readonly) NSString *name; ///< class name 154 | @property (nullable, nonatomic, strong, readonly) YYClassInfo *superClassInfo; ///< super class's class info 155 | @property (nullable, nonatomic, strong, readonly) NSDictionary *ivarInfos; ///< ivars 156 | @property (nullable, nonatomic, strong, readonly) NSDictionary *methodInfos; ///< methods 157 | @property (nullable, nonatomic, strong, readonly) NSDictionary *propertyInfos; ///< properties 158 | 159 | /** 160 | If the class is changed (for example: you add a method to this class with 161 | 'class_addMethod()'), you should call this method to refresh the class info cache. 162 | 163 | After called this method, `needUpdate` will returns `YES`, and you should call 164 | 'classInfoWithClass' or 'classInfoWithClassName' to get the updated class info. 165 | */ 166 | - (void)setNeedUpdate; 167 | 168 | /** 169 | If this method returns `YES`, you should stop using this instance and call 170 | `classInfoWithClass` or `classInfoWithClassName` to get the updated class info. 171 | 172 | @return Whether this class info need update. 173 | */ 174 | - (BOOL)needUpdate; 175 | 176 | /** 177 | Get the class info of a specified Class. 178 | 179 | @discussion This method will cache the class info and super-class info 180 | at the first access to the Class. This method is thread-safe. 181 | 182 | @param cls A class. 183 | @return A class info, or nil if an error occurs. 184 | */ 185 | + (nullable instancetype)classInfoWithClass:(Class)cls; 186 | 187 | /** 188 | Get the class info of a specified Class. 189 | 190 | @discussion This method will cache the class info and super-class info 191 | at the first access to the Class. This method is thread-safe. 192 | 193 | @param className A class name. 194 | @return A class info, or nil if an error occurs. 195 | */ 196 | + (nullable instancetype)classInfoWithClassName:(NSString *)className; 197 | 198 | @end 199 | 200 | NS_ASSUME_NONNULL_END 201 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/Controls/Button/NYSLabel.m: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2015 Leonard Hecker 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #import "NYSLabel.h" 26 | 27 | 28 | @implementation NYSLabel { 29 | NSRect _drawingRect; 30 | } 31 | 32 | #pragma mark - 33 | #pragma mark NSView overrides 34 | 35 | - (instancetype)init { 36 | return [self initWithFrame:NSZeroRect]; 37 | } 38 | 39 | - (instancetype)initWithFrame:(NSRect)frameRect { 40 | if (self = [super initWithFrame:frameRect]) { 41 | // _text, _attributedText and _preferredMaxLayoutWidth are nil/0 by default 42 | self.font = self.defaultFont; 43 | self.textColor = self.defaultTextColor; 44 | self.backgroundColor = self.defaultBackgroundColor; 45 | self.numberOfLines = 1; 46 | self.textAlignment = NSTextAlignmentLeft; 47 | self.lineBreakMode = NSLineBreakByTruncatingTail; 48 | } 49 | 50 | return self; 51 | } 52 | 53 | - (instancetype)initWithCoder:(NSCoder*)coder { 54 | if (self = [super initWithCoder:coder]) { 55 | NSString* text = nil; 56 | NSAttributedString* attributedText = nil; 57 | 58 | if ((text = [coder decodeObjectForKey:@"text"])) { 59 | self.text = text; 60 | } else if ((attributedText = [coder decodeObjectForKey:@"attributedText"])) { 61 | self.attributedText = attributedText; 62 | } 63 | 64 | self.font = [coder decodeObjectForKey:@"font"]; 65 | self.textColor = [coder decodeObjectForKey:@"textColor"]; 66 | self.backgroundColor = [coder decodeObjectForKey:@"backgroundColor"]; 67 | self.numberOfLines = [coder containsValueForKey:@"numberOfLines"] ? [[coder decodeObjectForKey:@"numberOfLines"] integerValue] : 1; 68 | self.textAlignment = [coder containsValueForKey:@"numberOfLines"] ? [[coder decodeObjectForKey:@"textAlignment"] unsignedIntegerValue] : NSTextAlignmentLeft; 69 | self.lineBreakMode = [coder containsValueForKey:@"numberOfLines"] ? [[coder decodeObjectForKey:@"lineBreakMode"] unsignedIntegerValue] : NSLineBreakByTruncatingTail; 70 | 71 | #if CGFLOAT_IS_DOUBLE 72 | self.preferredMaxLayoutWidth = [[coder decodeObjectForKey:@"preferredMaxLayoutWidth"] doubleValue]; 73 | #else 74 | self.preferredMaxLayoutWidth = [[coder decodeObjectForKey:@"preferredMaxLayoutWidth"] floatValue]; 75 | #endif 76 | } 77 | 78 | return self; 79 | } 80 | 81 | - (void)encodeWithCoder:(NSCoder*)aCoder { 82 | [super encodeWithCoder:aCoder]; 83 | 84 | NSString* text = nil; 85 | NSAttributedString* attributedText = nil; 86 | 87 | if ((text = self.text)) { 88 | [aCoder encodeObject:text forKey:@"text"]; 89 | } else if ((attributedText = self.attributedText)) { 90 | [aCoder encodeObject:attributedText forKey:@"attributedText"]; 91 | } 92 | 93 | [aCoder encodeObject:self.font forKey:@"font"]; 94 | [aCoder encodeObject:self.textColor forKey:@"textColor"]; 95 | [aCoder encodeObject:self.backgroundColor forKey:@"backgroundColor"]; 96 | [aCoder encodeObject:@(self.numberOfLines) forKey:@"numberOfLines"]; 97 | [aCoder encodeObject:@(self.textAlignment) forKey:@"textAlignment"]; 98 | [aCoder encodeObject:@(self.lineBreakMode) forKey:@"lineBreakMode"]; 99 | [aCoder encodeObject:@(self.preferredMaxLayoutWidth) forKey:@"preferredMaxLayoutWidth"]; 100 | } 101 | 102 | - (BOOL)isOpaque { 103 | return self.backgroundColor.alphaComponent == 1.0; 104 | } 105 | 106 | - (CGFloat)baselineOffsetFromBottom { 107 | return self.drawingRect.origin.y; 108 | } 109 | 110 | - (NSSize)intrinsicContentSize { 111 | return self.drawingRect.size; 112 | } 113 | 114 | - (void)invalidateIntrinsicContentSize { 115 | _drawingRect = NSZeroRect; 116 | [super invalidateIntrinsicContentSize]; 117 | } 118 | 119 | - (void)drawRect:(NSRect)dirtyRect { 120 | NSRect bounds = self.bounds; 121 | NSRect drawRect = {self.drawingRect.origin, bounds.size}; 122 | NSString* text = nil; 123 | NSAttributedString* attributedText = nil; 124 | 125 | [self.backgroundColor setFill]; 126 | NSRectFillUsingOperation(bounds, NSCompositingOperationSourceOver); 127 | 128 | if ((text = self.text)) { 129 | [text drawWithRect:drawRect options:self.drawingOptions attributes:@{ 130 | NSFontAttributeName : self.font, 131 | NSForegroundColorAttributeName : self.textColor, 132 | NSBackgroundColorAttributeName : self.backgroundColor, 133 | NSParagraphStyleAttributeName : self.drawingParagraphStyle, 134 | }]; 135 | } else if ((attributedText = self.attributedText)) { 136 | [attributedText drawWithRect:drawRect options:self.drawingOptions]; 137 | } 138 | } 139 | 140 | #pragma mark - 141 | #pragma mark private helper methods 142 | 143 | - (NSRect)drawingRect { 144 | // invalidated by [NSLabel invalidateIntrinsicContentSize] 145 | 146 | NSString* text = nil; 147 | NSAttributedString* attributedText = nil; 148 | 149 | if (NSIsEmptyRect(_drawingRect) && ((text = self.text) || (attributedText = self.attributedText))) { 150 | NSSize size = NSMakeSize(self.preferredMaxLayoutWidth, 0.0); 151 | 152 | if (text) { 153 | _drawingRect = [text boundingRectWithSize:size options:self.drawingOptions attributes:@{ 154 | NSFontAttributeName : self.font, 155 | NSForegroundColorAttributeName : self.textColor, 156 | NSBackgroundColorAttributeName : self.backgroundColor, 157 | NSParagraphStyleAttributeName : self.drawingParagraphStyle, 158 | }]; 159 | } else { 160 | _drawingRect = [attributedText boundingRectWithSize:size options:self.drawingOptions]; 161 | } 162 | 163 | _drawingRect = (NSRect) { 164 | { 165 | ceil(-_drawingRect.origin.x), 166 | ceil(-_drawingRect.origin.y), 167 | }, { 168 | ceil(_drawingRect.size.width), 169 | ceil(_drawingRect.size.height), 170 | } 171 | }; 172 | } 173 | 174 | return _drawingRect; 175 | } 176 | 177 | - (NSStringDrawingOptions)drawingOptions { 178 | NSStringDrawingOptions options = NSStringDrawingUsesFontLeading; 179 | 180 | if (self.numberOfLines == 0) { 181 | options |= NSStringDrawingUsesLineFragmentOrigin; 182 | } 183 | 184 | return options; 185 | } 186 | 187 | - (NSParagraphStyle*)drawingParagraphStyle { 188 | NSMutableParagraphStyle* ps = [NSMutableParagraphStyle new]; 189 | ps.alignment = self.textAlignment; 190 | 191 | if (self.numberOfLines) { 192 | ps.lineBreakMode = self.lineBreakMode; 193 | } 194 | 195 | return ps; 196 | } 197 | 198 | - (NSFont*)defaultFont { 199 | return [NSFont labelFontOfSize:12.0]; 200 | } 201 | 202 | - (NSColor*)defaultTextColor { 203 | return [NSColor blackColor]; 204 | } 205 | 206 | - (NSColor*)defaultBackgroundColor { 207 | return [NSColor windowBackgroundColor]; 208 | } 209 | 210 | #pragma mark - 211 | #pragma mark setters which invalidate the view 212 | 213 | - (void)setText:(NSString*)text { 214 | _text = [text copy]; 215 | _attributedText = nil; 216 | [self invalidateIntrinsicContentSize]; 217 | [self setNeedsDisplay:YES]; 218 | } 219 | 220 | - (void)setAttributedText:(NSAttributedString*)attributedText { 221 | _text = nil; 222 | _attributedText = [attributedText copy]; 223 | [self invalidateIntrinsicContentSize]; 224 | [self setNeedsDisplay:YES]; 225 | } 226 | 227 | - (void)setFont:(NSFont*)font { 228 | _font = font ? font : self.defaultFont; 229 | [self invalidateIntrinsicContentSize]; 230 | [self setNeedsDisplay:YES]; 231 | } 232 | 233 | - (void)setTextColor:(NSColor*)textColor { 234 | _textColor = textColor ? textColor : self.defaultTextColor; 235 | [self setNeedsDisplay:YES]; 236 | } 237 | 238 | - (void)setBackgroundColor:(NSColor*)backgroundColor { 239 | _backgroundColor = backgroundColor ? backgroundColor : self.defaultBackgroundColor; 240 | [self setNeedsDisplay:YES]; 241 | } 242 | 243 | - (void)setTextAlignment:(NSTextAlignment)textAlignment { 244 | _textAlignment = textAlignment; 245 | [self invalidateIntrinsicContentSize]; 246 | [self setNeedsDisplay:YES]; 247 | } 248 | 249 | - (void)setLineBreakMode:(NSLineBreakMode)lineBreakMode { 250 | _lineBreakMode = lineBreakMode; 251 | [self invalidateIntrinsicContentSize]; 252 | [self setNeedsDisplay:YES]; 253 | 254 | } 255 | 256 | @end 257 | -------------------------------------------------------------------------------- /EasyRelease/EasyRelease/Custom/ArtProgressHUD/ArtProgressHUD/ArtProgressHUD.m: -------------------------------------------------------------------------------- 1 | #import "ArtProgressHUD.h" 2 | #import 3 | #import "ArtHUDView.h" 4 | #import "AppDelegate.h" 5 | 6 | #define kWindowAlpha 0.86 7 | #define kCornerRadius 12 8 | 9 | 10 | static ArtProgressHUD *_hudProgress; 11 | 12 | @interface ArtProgressHUD () 13 | @property (nonatomic, assign) EArtProgressHUDType alertType; 14 | @property (nonatomic, strong) ArtHUDView *hudView; 15 | @property (nonatomic, strong) NSWindow *appWindow; 16 | @property (nonatomic, strong) NSTimer *dismissTimer; 17 | @property (nonatomic, strong) NSEvent *clickEvent; 18 | 19 | 20 | @property (weak) IBOutlet NSImageView *iconImageView; 21 | @property (weak) IBOutlet NSTextField *tipTextField; 22 | @property (weak) IBOutlet NSTextField *onlyTipTextField; 23 | @property (weak) IBOutlet NSProgressIndicator *loadingIndicator; 24 | 25 | 26 | @property (nonatomic, strong) NSView *popView; 27 | 28 | @end 29 | 30 | @implementation ArtProgressHUD 31 | 32 | + (void)showText:(NSString *)aText 33 | { 34 | [ArtProgressHUD showText:aText type:EArtProgressHUDTypeNone inView:nil]; 35 | } 36 | 37 | 38 | + (void)showInfoText:(NSString *)aText 39 | { 40 | [ArtProgressHUD showText:aText type:EArtProgressHUDInfo inView:nil]; 41 | } 42 | 43 | + (void)showErrorText:(NSString *)aText 44 | { 45 | [ArtProgressHUD showText:aText type:EArtProgressHUDError inView:nil]; 46 | } 47 | 48 | 49 | + (void)showSuccessText:(NSString *)aText 50 | { 51 | [ArtProgressHUD showText:aText type:EArtProgressHUDSuccess inView:nil]; 52 | } 53 | 54 | 55 | + (void)showText:(NSString *)aText type:(EArtProgressHUDType)aType inView:(NSView *)aView 56 | { 57 | if (!_hudProgress) { 58 | _hudProgress = [[self alloc] init]; 59 | } 60 | 61 | if (aView) { 62 | _hudProgress.popView = aView; 63 | } 64 | 65 | [ArtProgressHUD configImageNameWithType:aType]; 66 | 67 | _hudProgress.tipTextField.stringValue = aText; 68 | _hudProgress.onlyTipTextField.stringValue = aText; 69 | [_hudProgress.onlyTipTextField sizeToFit]; 70 | 71 | if (_hudProgress.window.parentWindow) { 72 | [_hudProgress.window.parentWindow removeChildWindow:_hudProgress.window]; 73 | } 74 | 75 | AppDelegate *delegate = [NSApplication sharedApplication].delegate; 76 | [delegate.mainWC.window addChildWindow:_hudProgress.window ordered:NSWindowAbove]; 77 | [_hudProgress showWindow:delegate.mainWC.window]; 78 | } 79 | 80 | + (void)showLoading 81 | { 82 | [ArtProgressHUD showLoading:nil]; 83 | } 84 | 85 | + (void)showLoading:(NSView *)aView; 86 | 87 | { 88 | if (!_hudProgress) { 89 | _hudProgress = [[self alloc] init]; 90 | } 91 | 92 | if (aView) { 93 | _hudProgress.popView = aView; 94 | } 95 | 96 | [ArtProgressHUD configImageNameWithType:EArtProgressHUDLoading]; 97 | 98 | if (_hudProgress.window.parentWindow) { 99 | [_hudProgress.window.parentWindow removeChildWindow:_hudProgress.window]; 100 | } 101 | 102 | AppDelegate *delegate = [NSApplication sharedApplication].delegate; 103 | [delegate.mainWC.window addChildWindow:_hudProgress.window ordered:NSWindowAbove]; 104 | [_hudProgress showWindow:delegate.mainWC.window]; 105 | } 106 | 107 | 108 | + (void)dismissLoading 109 | { 110 | [_hudProgress dismiss:nil]; 111 | } 112 | 113 | 114 | - (void)showImage:(NSImage*)image text:(NSString*)aText 115 | { 116 | 117 | } 118 | 119 | 120 | #pragma mark - Private Method 121 | 122 | + (void)configImageNameWithType:(EArtProgressHUDType)aType 123 | { 124 | NSString *iconName = nil; 125 | switch (aType) { 126 | case EArtProgressHUDError: 127 | iconName = @"MLHudAlertError"; 128 | break; 129 | case EArtProgressHUDInfo: 130 | iconName = @"MLHudAlertInfo"; 131 | break; 132 | case EArtProgressHUDSuccess: 133 | iconName = @"MLHudAlertSuccess"; 134 | break; 135 | case EArtProgressHUDWarning: 136 | iconName = @"MLHudAlertWarn"; 137 | break; 138 | default: 139 | break; 140 | } 141 | _hudProgress.alertType = aType; 142 | [ArtProgressHUD configUIWithType:aType imageName:iconName]; 143 | } 144 | 145 | + (void)configUIWithType:(EArtProgressHUDType)aType imageName:(NSString *)aName 146 | { 147 | if (aType == EArtProgressHUDLoading) { 148 | [_hudProgress.iconImageView setHidden:YES]; 149 | [_hudProgress.loadingIndicator setHidden:NO]; 150 | [_hudProgress.loadingIndicator startAnimation:nil]; 151 | [_hudProgress.tipTextField setHidden:YES]; 152 | [_hudProgress.onlyTipTextField setHidden:YES]; 153 | } else if (aType == EArtProgressHUDTypeNone) { 154 | [_hudProgress.iconImageView setHidden:YES]; 155 | [_hudProgress.loadingIndicator setHidden:YES]; 156 | [_hudProgress.tipTextField setHidden:YES]; 157 | [_hudProgress.onlyTipTextField setHidden:NO]; 158 | 159 | [_hudProgress.iconImageView removeConstraints:_hudProgress.iconImageView.constraints]; 160 | [_hudProgress.loadingIndicator removeConstraints:_hudProgress.loadingIndicator.constraints]; 161 | [_hudProgress.tipTextField removeConstraints:_hudProgress.tipTextField.constraints]; 162 | } else { 163 | [_hudProgress.loadingIndicator setHidden:YES]; 164 | [_hudProgress.iconImageView setHidden:NO]; 165 | _hudProgress.iconImageView.image = [NSImage imageNamed:aName]; 166 | [_hudProgress.onlyTipTextField setHidden:YES]; 167 | } 168 | } 169 | 170 | 171 | 172 | 173 | - (void)updateWindowPosition { 174 | if (!self.window.parentWindow) { 175 | return; 176 | } 177 | 178 | NSRect parentRect = self.window.parentWindow.frame; 179 | if (_hudProgress.popView) { 180 | parentRect = NSMakeRect(parentRect.origin.x+_hudProgress.popView.frame.origin.x, parentRect.origin.y+_hudProgress.popView.frame.origin.y, _hudProgress.popView.frame.size.width, _hudProgress.popView.frame.size.height); 181 | 182 | CGFloat width = _hudProgress.popView.frame.size.width>150?150:_hudProgress.popView.frame.size.width; 183 | CGFloat height = _hudProgress.popView.frame.size.height > 100?100:_hudProgress.popView.frame.size.height; 184 | [self.window setContentSize:NSMakeSize(width, height)]; 185 | } else { 186 | [self.window setContentSize:NSMakeSize(150, 100)]; 187 | } 188 | [self.window setFrameOrigin:NSMakePoint(NSMidX(parentRect) - NSWidth(self.window.frame) / 2, NSMidY(parentRect) - NSHeight(self.window.frame) / 2)]; 189 | } 190 | 191 | - (void)showWindow:(id)sender { 192 | self.window.alphaValue = 0; 193 | [super showWindow:sender]; 194 | [self updateWindowPosition]; 195 | [[self.window animator] setAlphaValue:kWindowAlpha]; 196 | 197 | if (self.alertType != EArtProgressHUDLoading) { 198 | // 延迟关闭 199 | [self.dismissTimer invalidate]; 200 | self.dismissTimer = [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(dismiss:) userInfo:nil repeats:NO]; 201 | 202 | // 点击任何区域关闭 Hud 203 | if (self.clickEvent) { 204 | [NSEvent removeMonitor:self.clickEvent]; 205 | } 206 | 207 | __weak typeof(self) weakSelf = self; 208 | self.clickEvent = [NSEvent addLocalMonitorForEventsMatchingMask:(NSEventMaskLeftMouseDown | NSEventMaskRightMouseDown) handler:^NSEvent *(NSEvent *e) { 209 | if (!NSPointInRect(NSEvent.mouseLocation, self.window.frame)) { 210 | if (weakSelf.clickEvent) { 211 | [NSEvent removeMonitor:weakSelf.clickEvent]; 212 | weakSelf.clickEvent = nil; 213 | } 214 | 215 | [self dismiss:nil]; 216 | } 217 | return e; 218 | }]; 219 | } else { 220 | 221 | } 222 | } 223 | 224 | - (void)dismiss:(id)sender { 225 | [[self.window animator] setAlphaValue:0.0]; 226 | _hudProgress = nil; 227 | } 228 | 229 | - (id)init { 230 | self = [super init]; 231 | if (self) { 232 | [self loadNibNamed:@"ArtProgressHUD" owner:self]; 233 | } 234 | return self; 235 | } 236 | 237 | 238 | - (void)loadNibNamed:(NSString *)nibName owner:(id)owner { 239 | [[NSBundle mainBundle] loadNibNamed:nibName owner:owner topLevelObjects:nil]; 240 | } 241 | 242 | - (void)awakeFromNib { 243 | [(ArtHUDView *)self.window setCornerRadius:kCornerRadius]; 244 | [self.tipTextField setTextColor:[NSColor whiteColor]]; 245 | [self.tipTextField.cell setBackgroundStyle:NSBackgroundStyleLowered]; 246 | self.tipTextField.preferredMaxLayoutWidth = 120; 247 | 248 | [self.iconImageView setImageScaling:NSImageScaleAxesIndependently]; 249 | // self.loadingIndicator.controlTint = NSBlueControlTint; 250 | 251 | CIFilter *lighten = [CIFilter filterWithName:@"CIColorControls"]; 252 | [lighten setDefaults]; 253 | [lighten setValue:@1 forKey:@"inputBrightness"]; 254 | [self.loadingIndicator setContentFilters:[NSArray arrayWithObjects:lighten, nil]]; 255 | 256 | } 257 | 258 | - (void)mouseDown:(NSEvent *)theEvent { 259 | if (self.alertType != EArtProgressHUDLoading) { 260 | [self dismiss:nil]; 261 | } 262 | } 263 | 264 | 265 | 266 | @end 267 | --------------------------------------------------------------------------------