├── .gitignore ├── LICENSE ├── README.md ├── colorfulSidebarX.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── colorfulSidebarX.xcscheme ├── colorfulSidebarX ├── Image │ ├── ArchiveMailbox.tiff │ ├── DraftsMailboxLarge.tiff │ ├── InMailboxLarge.tiff │ ├── NormalMailboxLarge_ContainerOnly.tiff │ ├── SentMailboxLarge.tiff │ ├── junkmail.tiff │ ├── logs.png │ ├── pinwheel.png │ ├── preview.png │ └── profit.png ├── Info.plist ├── JSRollCall │ ├── JSRollCall.h │ └── JSRollCall.m ├── Plists │ ├── icons10.plist │ ├── icons14.plist │ └── icons9.plist ├── ZKSwizzle │ ├── ZKSwizzle.h │ └── ZKSwizzle.m └── colorfulSidebarX.m └── preview.png /.gitignore: -------------------------------------------------------------------------------- 1 | ##### 2 | # OS X temporary files that should never be committed 3 | .DS_Store 4 | *.swp 5 | *.lock 6 | profile 7 | 8 | ##### 9 | # DotEnv files 10 | .env 11 | 12 | #### 13 | # Xcode temporary files that should never be committed 14 | *~.nib 15 | 16 | #### 17 | # Objective-C/Swift specific 18 | *.hmap 19 | *.ipa 20 | 21 | #### 22 | # Xcode build files 23 | DerivedData/ 24 | build/ 25 | Builds/ 26 | 27 | ##### 28 | # Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups) 29 | *.pbxuser 30 | *.mode1v3 31 | *.mode2v3 32 | *.perspectivev3 33 | !default.pbxuser 34 | !default.mode1v3 35 | !default.mode2v3 36 | !default.perspectivev3 37 | 38 | #### 39 | # Xcode 4 40 | xcuserdata 41 | !xcschemes 42 | # Xcode 4 43 | *.moved-aside 44 | 45 | #### 46 | # XCode 4 workspaces - more detailed 47 | !xcshareddata 48 | !default.xcworkspace 49 | *.xcworkspacedata 50 | 51 | 52 | #### 53 | # Xcode 5 54 | *.xccheckout 55 | *.xcuserstate 56 | 57 | #### 58 | # Xcode 7 59 | *.xcscmblueprint 60 | 61 | #### 62 | # AppCode 63 | .idea/ 64 | 65 | #### 66 | # Other Xcode files 67 | profile 68 | *.hmap 69 | *.ipa -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Wolfgang Baird 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # colorfulSidebarX 2 | 3 | ![preview](preview.png) 4 | 5 | # Information: 6 | 7 | - Designed for macOS 10.9+ 8 | - colorfulSidebarX is a MacForge plugin that brings back sidebar color on macOS 9 | - Author: [w0lfschild](https://github.com/w0lfschild) 10 | 11 | # Note: 12 | 13 | - You can customize the icons used by editing the `icons.plist` that corresponds to your macOS version: 14 | - macOS 10.9 : `icons9.plist` 15 | - macOS 10.10 - 10.13 : `icons10.plist` 16 | - macOS 10.14 + : `icons14.plist` 17 | 18 | # Installation: 19 | 20 | 1. Download [MacForge](https://github.com/w0lfschild/app_updates/raw/master/MacForge/MacForge.zip) 21 | 2. Install [colorfulSidebar](https://www.macenhance.com/mflink?macforge://github.com/w0lfschild/myRepo/raw/master/myPaidRepo/org.w0lf.colorfulSidebar9) using MacForge 22 | 23 | ### License: 24 | [Link](LICENSE) 25 | -------------------------------------------------------------------------------- /colorfulSidebarX.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | F3D5D09524297B5B0003EE62 /* icons14.plist in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D09224297B5B0003EE62 /* icons14.plist */; }; 11 | F3D5D09624297B5B0003EE62 /* icons9.plist in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D09324297B5B0003EE62 /* icons9.plist */; }; 12 | F3D5D0B624297BDC0003EE62 /* logs.png in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0AC24297BDB0003EE62 /* logs.png */; }; 13 | F3D5D0B724297BDC0003EE62 /* preview.png in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0AD24297BDB0003EE62 /* preview.png */; }; 14 | F3D5D0B824297BDC0003EE62 /* InMailboxLarge.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0AE24297BDB0003EE62 /* InMailboxLarge.tiff */; }; 15 | F3D5D0B924297BDC0003EE62 /* DraftsMailboxLarge.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0AF24297BDB0003EE62 /* DraftsMailboxLarge.tiff */; }; 16 | F3D5D0BA24297BDC0003EE62 /* junkmail.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0B024297BDB0003EE62 /* junkmail.tiff */; }; 17 | F3D5D0BB24297BDC0003EE62 /* pinwheel.png in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0B124297BDB0003EE62 /* pinwheel.png */; }; 18 | F3D5D0BC24297BDC0003EE62 /* profit.png in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0B224297BDB0003EE62 /* profit.png */; }; 19 | F3D5D0BD24297BDC0003EE62 /* NormalMailboxLarge_ContainerOnly.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0B324297BDC0003EE62 /* NormalMailboxLarge_ContainerOnly.tiff */; }; 20 | F3D5D0BE24297BDC0003EE62 /* ArchiveMailbox.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0B424297BDC0003EE62 /* ArchiveMailbox.tiff */; }; 21 | F3D5D0BF24297BDC0003EE62 /* SentMailboxLarge.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0B524297BDC0003EE62 /* SentMailboxLarge.tiff */; }; 22 | F3D5D0C624297C040003EE62 /* ZKSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = F3D5D0C424297C040003EE62 /* ZKSwizzle.m */; }; 23 | F3D5D0CA24297C310003EE62 /* JSRollCall.m in Sources */ = {isa = PBXBuildFile; fileRef = F3D5D0C924297C310003EE62 /* JSRollCall.m */; }; 24 | F3D5D0CD24297CDD0003EE62 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = F3D5D0CC24297CDD0003EE62 /* Info.plist */; }; 25 | F3D5D0CF24297CEA0003EE62 /* colorfulSidebarX.m in Sources */ = {isa = PBXBuildFile; fileRef = F3D5D0CE24297CEA0003EE62 /* colorfulSidebarX.m */; }; 26 | FB410B1E245008C40051CD67 /* icons10.plist in Resources */ = {isa = PBXBuildFile; fileRef = FB410B1D245008C40051CD67 /* icons10.plist */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 8D5B49B6048680CD000E48DA /* colorfulSidebarX.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = colorfulSidebarX.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | F3D5D09224297B5B0003EE62 /* icons14.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = icons14.plist; sourceTree = ""; }; 32 | F3D5D09324297B5B0003EE62 /* icons9.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = icons9.plist; sourceTree = ""; }; 33 | F3D5D0AC24297BDB0003EE62 /* logs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logs.png; sourceTree = ""; }; 34 | F3D5D0AD24297BDB0003EE62 /* preview.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = preview.png; sourceTree = ""; }; 35 | F3D5D0AE24297BDB0003EE62 /* InMailboxLarge.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = InMailboxLarge.tiff; sourceTree = ""; }; 36 | F3D5D0AF24297BDB0003EE62 /* DraftsMailboxLarge.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = DraftsMailboxLarge.tiff; sourceTree = ""; }; 37 | F3D5D0B024297BDB0003EE62 /* junkmail.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = junkmail.tiff; sourceTree = ""; }; 38 | F3D5D0B124297BDB0003EE62 /* pinwheel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pinwheel.png; sourceTree = ""; }; 39 | F3D5D0B224297BDB0003EE62 /* profit.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = profit.png; sourceTree = ""; }; 40 | F3D5D0B324297BDC0003EE62 /* NormalMailboxLarge_ContainerOnly.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = NormalMailboxLarge_ContainerOnly.tiff; sourceTree = ""; }; 41 | F3D5D0B424297BDC0003EE62 /* ArchiveMailbox.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = ArchiveMailbox.tiff; sourceTree = ""; }; 42 | F3D5D0B524297BDC0003EE62 /* SentMailboxLarge.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = SentMailboxLarge.tiff; sourceTree = ""; }; 43 | F3D5D0C424297C040003EE62 /* ZKSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ZKSwizzle.m; path = ../ZKSwizzle/ZKSwizzle.m; sourceTree = ""; }; 44 | F3D5D0C524297C040003EE62 /* ZKSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZKSwizzle.h; path = ../ZKSwizzle/ZKSwizzle.h; sourceTree = ""; }; 45 | F3D5D0C824297C310003EE62 /* JSRollCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSRollCall.h; path = ../JSRollCall/JSRollCall.h; sourceTree = ""; }; 46 | F3D5D0C924297C310003EE62 /* JSRollCall.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JSRollCall.m; path = ../JSRollCall/JSRollCall.m; sourceTree = ""; }; 47 | F3D5D0CC24297CDD0003EE62 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | F3D5D0CE24297CEA0003EE62 /* colorfulSidebarX.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = colorfulSidebarX.m; sourceTree = ""; }; 49 | FB410B1D245008C40051CD67 /* icons10.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = icons10.plist; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 8D5B49B3048680CD000E48DA /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXFrameworksBuildPhase section */ 61 | 62 | /* Begin PBXGroup section */ 63 | 089C166AFE841209C02AAC07 /* ColorfulSidebar */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | 08FB77AFFE84173DC02AAC07 /* colorfulSidebarX */, 67 | 19C28FB8FE9D52D311CA2CBB /* Products */, 68 | ); 69 | name = ColorfulSidebar; 70 | sourceTree = ""; 71 | }; 72 | 08FB77AFFE84173DC02AAC07 /* colorfulSidebarX */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | F3D5D0CB24297C340003EE62 /* JSRollCall */, 76 | F3D5D0C724297C080003EE62 /* ZKSwizzle */, 77 | F3D5D0AB24297BAF0003EE62 /* Image */, 78 | F3D5D09024297B2D0003EE62 /* Plists */, 79 | F3D5D0CE24297CEA0003EE62 /* colorfulSidebarX.m */, 80 | F3D5D0CC24297CDD0003EE62 /* Info.plist */, 81 | ); 82 | path = colorfulSidebarX; 83 | sourceTree = ""; 84 | }; 85 | 19C28FB8FE9D52D311CA2CBB /* Products */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 8D5B49B6048680CD000E48DA /* colorfulSidebarX.bundle */, 89 | ); 90 | name = Products; 91 | sourceTree = ""; 92 | }; 93 | F3D5D09024297B2D0003EE62 /* Plists */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | F3D5D09324297B5B0003EE62 /* icons9.plist */, 97 | FB410B1D245008C40051CD67 /* icons10.plist */, 98 | F3D5D09224297B5B0003EE62 /* icons14.plist */, 99 | ); 100 | path = Plists; 101 | sourceTree = ""; 102 | }; 103 | F3D5D0AB24297BAF0003EE62 /* Image */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | F3D5D0B424297BDC0003EE62 /* ArchiveMailbox.tiff */, 107 | F3D5D0AF24297BDB0003EE62 /* DraftsMailboxLarge.tiff */, 108 | F3D5D0AE24297BDB0003EE62 /* InMailboxLarge.tiff */, 109 | F3D5D0B024297BDB0003EE62 /* junkmail.tiff */, 110 | F3D5D0AC24297BDB0003EE62 /* logs.png */, 111 | F3D5D0B324297BDC0003EE62 /* NormalMailboxLarge_ContainerOnly.tiff */, 112 | F3D5D0B124297BDB0003EE62 /* pinwheel.png */, 113 | F3D5D0AD24297BDB0003EE62 /* preview.png */, 114 | F3D5D0B224297BDB0003EE62 /* profit.png */, 115 | F3D5D0B524297BDC0003EE62 /* SentMailboxLarge.tiff */, 116 | ); 117 | path = Image; 118 | sourceTree = ""; 119 | }; 120 | F3D5D0C724297C080003EE62 /* ZKSwizzle */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | F3D5D0C524297C040003EE62 /* ZKSwizzle.h */, 124 | F3D5D0C424297C040003EE62 /* ZKSwizzle.m */, 125 | ); 126 | path = ZKSwizzle; 127 | sourceTree = ""; 128 | }; 129 | F3D5D0CB24297C340003EE62 /* JSRollCall */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | F3D5D0C824297C310003EE62 /* JSRollCall.h */, 133 | F3D5D0C924297C310003EE62 /* JSRollCall.m */, 134 | ); 135 | path = JSRollCall; 136 | sourceTree = ""; 137 | }; 138 | /* End PBXGroup section */ 139 | 140 | /* Begin PBXNativeTarget section */ 141 | 8D5B49AC048680CD000E48DA /* colorfulSidebarX */ = { 142 | isa = PBXNativeTarget; 143 | buildConfigurationList = 1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "colorfulSidebarX" */; 144 | buildPhases = ( 145 | 8D5B49AF048680CD000E48DA /* Resources */, 146 | 8D5B49B1048680CD000E48DA /* Sources */, 147 | 8D5B49B3048680CD000E48DA /* Frameworks */, 148 | F3D5D0D524297D670003EE62 /* ShellScript */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | ); 154 | name = colorfulSidebarX; 155 | productInstallPath = "$(HOME)/Library/Bundles"; 156 | productName = ColorfulSidebar; 157 | productReference = 8D5B49B6048680CD000E48DA /* colorfulSidebarX.bundle */; 158 | productType = "com.apple.product-type.bundle"; 159 | }; 160 | /* End PBXNativeTarget section */ 161 | 162 | /* Begin PBXProject section */ 163 | 089C1669FE841209C02AAC07 /* Project object */ = { 164 | isa = PBXProject; 165 | attributes = { 166 | LastUpgradeCheck = 1130; 167 | ORGANIZATIONNAME = cvz.; 168 | TargetAttributes = { 169 | 8D5B49AC048680CD000E48DA = { 170 | DevelopmentTeam = EX596BNL45; 171 | ProvisioningStyle = Automatic; 172 | }; 173 | }; 174 | }; 175 | buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "colorfulSidebarX" */; 176 | compatibilityVersion = "Xcode 3.2"; 177 | developmentRegion = en; 178 | hasScannedForEncodings = 1; 179 | knownRegions = ( 180 | en, 181 | Base, 182 | ); 183 | mainGroup = 089C166AFE841209C02AAC07 /* ColorfulSidebar */; 184 | projectDirPath = ""; 185 | projectRoot = ""; 186 | targets = ( 187 | 8D5B49AC048680CD000E48DA /* colorfulSidebarX */, 188 | ); 189 | }; 190 | /* End PBXProject section */ 191 | 192 | /* Begin PBXResourcesBuildPhase section */ 193 | 8D5B49AF048680CD000E48DA /* Resources */ = { 194 | isa = PBXResourcesBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | F3D5D0BE24297BDC0003EE62 /* ArchiveMailbox.tiff in Resources */, 198 | F3D5D0B824297BDC0003EE62 /* InMailboxLarge.tiff in Resources */, 199 | F3D5D0B924297BDC0003EE62 /* DraftsMailboxLarge.tiff in Resources */, 200 | F3D5D0BB24297BDC0003EE62 /* pinwheel.png in Resources */, 201 | F3D5D0BF24297BDC0003EE62 /* SentMailboxLarge.tiff in Resources */, 202 | F3D5D0B624297BDC0003EE62 /* logs.png in Resources */, 203 | F3D5D0CD24297CDD0003EE62 /* Info.plist in Resources */, 204 | F3D5D09624297B5B0003EE62 /* icons9.plist in Resources */, 205 | F3D5D09524297B5B0003EE62 /* icons14.plist in Resources */, 206 | F3D5D0BD24297BDC0003EE62 /* NormalMailboxLarge_ContainerOnly.tiff in Resources */, 207 | FB410B1E245008C40051CD67 /* icons10.plist in Resources */, 208 | F3D5D0BC24297BDC0003EE62 /* profit.png in Resources */, 209 | F3D5D0B724297BDC0003EE62 /* preview.png in Resources */, 210 | F3D5D0BA24297BDC0003EE62 /* junkmail.tiff in Resources */, 211 | ); 212 | runOnlyForDeploymentPostprocessing = 0; 213 | }; 214 | /* End PBXResourcesBuildPhase section */ 215 | 216 | /* Begin PBXShellScriptBuildPhase section */ 217 | F3D5D0D524297D670003EE62 /* ShellScript */ = { 218 | isa = PBXShellScriptBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | ); 222 | inputPaths = ( 223 | ); 224 | outputPaths = ( 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | shellPath = /bin/sh; 228 | shellScript = "# Increment build number\n\nbuildNumber=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"${INFOPLIST_FILE}\")\nbuildNumber=$(($buildNumber + 1))\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"${INFOPLIST_FILE}\"\n"; 229 | }; 230 | /* End PBXShellScriptBuildPhase section */ 231 | 232 | /* Begin PBXSourcesBuildPhase section */ 233 | 8D5B49B1048680CD000E48DA /* Sources */ = { 234 | isa = PBXSourcesBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | F3D5D0CF24297CEA0003EE62 /* colorfulSidebarX.m in Sources */, 238 | F3D5D0C624297C040003EE62 /* ZKSwizzle.m in Sources */, 239 | F3D5D0CA24297C310003EE62 /* JSRollCall.m in Sources */, 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | }; 243 | /* End PBXSourcesBuildPhase section */ 244 | 245 | /* Begin XCBuildConfiguration section */ 246 | 1DEB913B08733D840010E9CD /* Debug */ = { 247 | isa = XCBuildConfiguration; 248 | buildSettings = { 249 | ALWAYS_SEARCH_USER_PATHS = NO; 250 | CLANG_ENABLE_OBJC_ARC = YES; 251 | CLANG_ENABLE_OBJC_WEAK = YES; 252 | CODE_SIGN_IDENTITY = "Mac Developer"; 253 | CODE_SIGN_STYLE = Automatic; 254 | COMBINE_HIDPI_IMAGES = YES; 255 | COPY_PHASE_STRIP = NO; 256 | CURRENT_PROJECT_VERSION = 201; 257 | DEPLOYMENT_LOCATION = YES; 258 | DEVELOPMENT_TEAM = EX596BNL45; 259 | DSTROOT = /; 260 | GCC_DYNAMIC_NO_PIC = NO; 261 | GCC_MODEL_TUNING = G5; 262 | GCC_OPTIMIZATION_LEVEL = 0; 263 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 264 | INFOPLIST_FILE = "$(SRCROOT)/colorfulSidebarX/Info.plist"; 265 | INSTALL_PATH = "/Library/Application Support/MacEnhance/Plugins"; 266 | MARKETING_VERSION = 2.0.1; 267 | PRODUCT_BUNDLE_IDENTIFIER = com.macenhance.colorfulSidebarX; 268 | PRODUCT_NAME = colorfulSidebarX; 269 | PROVISIONING_PROFILE_SPECIFIER = ""; 270 | WRAPPER_EXTENSION = bundle; 271 | }; 272 | name = Debug; 273 | }; 274 | 1DEB913C08733D840010E9CD /* Release */ = { 275 | isa = XCBuildConfiguration; 276 | buildSettings = { 277 | ALWAYS_SEARCH_USER_PATHS = NO; 278 | CLANG_ENABLE_OBJC_ARC = YES; 279 | CLANG_ENABLE_OBJC_WEAK = YES; 280 | CODE_SIGN_IDENTITY = "Mac Developer"; 281 | CODE_SIGN_STYLE = Automatic; 282 | COMBINE_HIDPI_IMAGES = YES; 283 | CURRENT_PROJECT_VERSION = 201; 284 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 285 | DEPLOYMENT_LOCATION = YES; 286 | DEVELOPMENT_TEAM = EX596BNL45; 287 | DSTROOT = /; 288 | GCC_MODEL_TUNING = G5; 289 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 290 | INFOPLIST_FILE = "$(SRCROOT)/colorfulSidebarX/Info.plist"; 291 | INSTALL_PATH = "/Library/Application Support/MacEnhance/Plugins"; 292 | MARKETING_VERSION = 2.0.1; 293 | PRODUCT_BUNDLE_IDENTIFIER = com.macenhance.colorfulSidebarX; 294 | PRODUCT_NAME = colorfulSidebarX; 295 | PROVISIONING_PROFILE_SPECIFIER = ""; 296 | WRAPPER_EXTENSION = bundle; 297 | }; 298 | name = Release; 299 | }; 300 | 1DEB913F08733D840010E9CD /* Debug */ = { 301 | isa = XCBuildConfiguration; 302 | buildSettings = { 303 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 304 | CLANG_ENABLE_MODULES = YES; 305 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 306 | CLANG_WARN_BOOL_CONVERSION = YES; 307 | CLANG_WARN_COMMA = YES; 308 | CLANG_WARN_CONSTANT_CONVERSION = YES; 309 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 310 | CLANG_WARN_EMPTY_BODY = YES; 311 | CLANG_WARN_ENUM_CONVERSION = YES; 312 | CLANG_WARN_INFINITE_RECURSION = YES; 313 | CLANG_WARN_INT_CONVERSION = YES; 314 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 315 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 316 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 317 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 318 | CLANG_WARN_STRICT_PROTOTYPES = YES; 319 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 320 | CLANG_WARN_UNREACHABLE_CODE = YES; 321 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 322 | ENABLE_STRICT_OBJC_MSGSEND = YES; 323 | ENABLE_TESTABILITY = YES; 324 | GCC_C_LANGUAGE_STANDARD = gnu99; 325 | GCC_NO_COMMON_BLOCKS = YES; 326 | GCC_OPTIMIZATION_LEVEL = 0; 327 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 328 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 329 | GCC_WARN_UNDECLARED_SELECTOR = YES; 330 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 331 | GCC_WARN_UNUSED_FUNCTION = YES; 332 | GCC_WARN_UNUSED_VARIABLE = YES; 333 | MACOSX_DEPLOYMENT_TARGET = 10.9; 334 | ONLY_ACTIVE_ARCH = YES; 335 | SDKROOT = macosx; 336 | }; 337 | name = Debug; 338 | }; 339 | 1DEB914008733D840010E9CD /* Release */ = { 340 | isa = XCBuildConfiguration; 341 | buildSettings = { 342 | CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; 343 | CLANG_ENABLE_MODULES = YES; 344 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 345 | CLANG_WARN_BOOL_CONVERSION = YES; 346 | CLANG_WARN_COMMA = YES; 347 | CLANG_WARN_CONSTANT_CONVERSION = YES; 348 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 349 | CLANG_WARN_EMPTY_BODY = YES; 350 | CLANG_WARN_ENUM_CONVERSION = YES; 351 | CLANG_WARN_INFINITE_RECURSION = YES; 352 | CLANG_WARN_INT_CONVERSION = YES; 353 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 355 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 356 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 357 | CLANG_WARN_STRICT_PROTOTYPES = YES; 358 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 359 | CLANG_WARN_UNREACHABLE_CODE = YES; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | ENABLE_STRICT_OBJC_MSGSEND = YES; 362 | GCC_C_LANGUAGE_STANDARD = gnu99; 363 | GCC_NO_COMMON_BLOCKS = YES; 364 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 365 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 366 | GCC_WARN_UNDECLARED_SELECTOR = YES; 367 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 368 | GCC_WARN_UNUSED_FUNCTION = YES; 369 | GCC_WARN_UNUSED_VARIABLE = YES; 370 | MACOSX_DEPLOYMENT_TARGET = 10.9; 371 | ONLY_ACTIVE_ARCH = NO; 372 | SDKROOT = macosx; 373 | }; 374 | name = Release; 375 | }; 376 | /* End XCBuildConfiguration section */ 377 | 378 | /* Begin XCConfigurationList section */ 379 | 1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "colorfulSidebarX" */ = { 380 | isa = XCConfigurationList; 381 | buildConfigurations = ( 382 | 1DEB913B08733D840010E9CD /* Debug */, 383 | 1DEB913C08733D840010E9CD /* Release */, 384 | ); 385 | defaultConfigurationIsVisible = 0; 386 | defaultConfigurationName = Release; 387 | }; 388 | 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "colorfulSidebarX" */ = { 389 | isa = XCConfigurationList; 390 | buildConfigurations = ( 391 | 1DEB913F08733D840010E9CD /* Debug */, 392 | 1DEB914008733D840010E9CD /* Release */, 393 | ); 394 | defaultConfigurationIsVisible = 0; 395 | defaultConfigurationName = Release; 396 | }; 397 | /* End XCConfigurationList section */ 398 | }; 399 | rootObject = 089C1669FE841209C02AAC07 /* Project object */; 400 | } 401 | -------------------------------------------------------------------------------- /colorfulSidebarX.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /colorfulSidebarX.xcodeproj/xcshareddata/xcschemes/colorfulSidebarX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /colorfulSidebarX/Image/ArchiveMailbox.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/colorfulSidebarX/Image/ArchiveMailbox.tiff -------------------------------------------------------------------------------- /colorfulSidebarX/Image/DraftsMailboxLarge.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/colorfulSidebarX/Image/DraftsMailboxLarge.tiff -------------------------------------------------------------------------------- /colorfulSidebarX/Image/InMailboxLarge.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/colorfulSidebarX/Image/InMailboxLarge.tiff -------------------------------------------------------------------------------- /colorfulSidebarX/Image/NormalMailboxLarge_ContainerOnly.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/colorfulSidebarX/Image/NormalMailboxLarge_ContainerOnly.tiff -------------------------------------------------------------------------------- /colorfulSidebarX/Image/SentMailboxLarge.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/colorfulSidebarX/Image/SentMailboxLarge.tiff -------------------------------------------------------------------------------- /colorfulSidebarX/Image/junkmail.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/colorfulSidebarX/Image/junkmail.tiff -------------------------------------------------------------------------------- /colorfulSidebarX/Image/logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/colorfulSidebarX/Image/logs.png -------------------------------------------------------------------------------- /colorfulSidebarX/Image/pinwheel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/colorfulSidebarX/Image/pinwheel.png -------------------------------------------------------------------------------- /colorfulSidebarX/Image/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/colorfulSidebarX/Image/preview.png -------------------------------------------------------------------------------- /colorfulSidebarX/Image/profit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/colorfulSidebarX/Image/profit.png -------------------------------------------------------------------------------- /colorfulSidebarX/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 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 | BNDL 19 | CFBundleShortVersionString 20 | 2.0.3 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 241 25 | NSHumanReadableCopyright 26 | Copyright © 2016 - 2019, macEnhance 27 | NSPrincipalClass 28 | 29 | SIMBLTargetApplications 30 | 31 | 32 | BundleIdentifier 33 | com.apple.finder 34 | 35 | 36 | BundleIdentifier 37 | com.apple.appkit.xpc.openAndSavePanelService 38 | 39 | 40 | BundleIdentifier 41 | com.apple.security.pboxd 42 | 43 | 44 | BundleIdentifier 45 | * 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /colorfulSidebarX/JSRollCall/JSRollCall.h: -------------------------------------------------------------------------------- 1 | // 2 | // JSRollCall.h 3 | // JSRollCall 4 | // 5 | // Created by Jeremy Legendre on 3/1/20. 6 | // Copyright © 2020 Jeremy Legendre. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define MAX_RESULTS 128 12 | 13 | @interface JSRollCall : NSObject 14 | 15 | - (NSSet *)allObjectsOfClass:(Class)cls includeSubclass:(BOOL)shouldIncludeSubclasses; 16 | - (NSSet *)allObjectsOfClassName:(NSString *)className includeSubclass:(BOOL)shouldIncludeSubclasses; 17 | - (void)allObjectsOfClass:(Class)cls includeSubclass:(BOOL)shouldIncludeSubclasses performBlock:(void (^)(id))block; 18 | - (void)allObjectsOfClassName:(NSString *)cls includeSubclass:(BOOL)shouldIncludeSubclasses performBlock:(void (^)(id))block; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /colorfulSidebarX/JSRollCall/JSRollCall.m: -------------------------------------------------------------------------------- 1 | // 2 | // JSRollCall.m 3 | // JSRollCall 4 | // 5 | // Created by Jeremy Legendre on 3/1/20. 6 | // Copyright © 2020 Jeremy Legendre. All rights reserved. 7 | // 8 | 9 | #import "JSRollCall.h" 10 | #include 11 | #include 12 | 13 | struct rc_ctx { 14 | Class cls; 15 | CFMutableSetRef classesSet; 16 | CFMutableSetRef results; 17 | uint32_t classCount; 18 | boolean_t includeSubclass; 19 | }; 20 | typedef struct rc_ctx* rc_ctx_t; 21 | 22 | static kern_return_t 23 | task_peek (task_t task, vm_address_t remote_address, vm_size_t size, void **local_memory) { 24 | *local_memory = (void*) remote_address; 25 | return KERN_SUCCESS; 26 | } 27 | 28 | void malloc_zone_enumerator(task_t task, void *context, unsigned type, vm_range_t *ranges, unsigned count) { 29 | rc_ctx_t ctx = (rc_ctx_t)context; 30 | CFMutableSetRef classesSet = ctx->classesSet; 31 | CFMutableSetRef results = ctx->results; 32 | boolean_t includeSublass = ctx->includeSubclass; 33 | int maxCount = MAX_RESULTS; 34 | 35 | for (int j = 0; j < count; j++) { 36 | if (CFSetGetCount(results) >= maxCount) 37 | break; 38 | 39 | vm_address_t potentialObject = ranges[j].address; 40 | 41 | Class cls = ctx->cls; 42 | size_t clsSize = class_getInstanceSize(cls); 43 | // test 1 44 | if (ranges[j].size < clsSize) 45 | continue; 46 | 47 | // ignore tagged pointer stuff 48 | if ((0xFFFF800000000000 & potentialObject) != 0) 49 | continue; 50 | 51 | // test 4 is a tagged pointer 0x8000000000000000 52 | if ((potentialObject & 0x8000000000000000) == 0x8000000000000000) 53 | continue; 54 | 55 | Class potentialClass = object_getClass((__bridge id)((void *)potentialObject)); 56 | // test 2 57 | if (!CFSetContainsValue(classesSet, (__bridge const void *)(potentialClass))) { 58 | continue; 59 | } 60 | 61 | NSString *className = (NSString *)NSStringFromClass(potentialClass); 62 | 63 | // test 3 64 | if (malloc_good_size(class_getInstanceSize(potentialClass)) != ranges[j].size && !(BOOL)[className containsString:@"Block"]) { 65 | continue; 66 | } 67 | 68 | id obj = (__bridge id)(void *)potentialObject; 69 | 70 | if ([obj isProxy] && strchr((char*)[className UTF8String], '.') == 0) 71 | continue; 72 | 73 | 74 | if (![obj respondsToSelector:@selector(description)]) 75 | continue; 76 | 77 | if([className isEqualToString:NSStringFromClass(cls)] || 78 | (includeSublass && [potentialClass isSubclassOfClass:cls])) { 79 | CFSetAddValue(results, (const void *)(potentialObject)); 80 | } 81 | } 82 | } 83 | 84 | @interface JSRollCall () 85 | @property (strong, atomic) NSMutableArray *contexts; 86 | @end 87 | 88 | @implementation JSRollCall 89 | 90 | - (void)initCallbackCtx:(rc_ctx_t *)ctx { 91 | *ctx = (rc_ctx_t)calloc(1, sizeof(struct rc_ctx)); 92 | int classCount = objc_getClassList(NULL, 0); 93 | CFMutableSetRef set = CFSetCreateMutable(0, classCount, NULL); 94 | Class *classes = (__unsafe_unretained Class *)malloc(sizeof(Class) * classCount); 95 | objc_getClassList(classes, classCount); 96 | 97 | for (int i = 0; i < classCount; i++) { 98 | Class cls = classes[i]; 99 | CFSetAddValue(set, (__bridge const void *)(cls)); 100 | } 101 | 102 | (*ctx)->results = (CFMutableSetRef)CFSetCreateMutable(0, MAX_RESULTS, NULL); 103 | (*ctx)->classesSet = set; 104 | (*ctx)->includeSubclass = false; 105 | } 106 | 107 | - (void)destroyCallbackCtx:(rc_ctx_t)ctx { 108 | free(ctx); 109 | } 110 | 111 | - (void)enumerateWithContext:(rc_ctx_t)ctx { 112 | vm_address_t *zones = NULL; 113 | unsigned int count = 0; 114 | 115 | 116 | kern_return_t error = malloc_get_all_zones(0, 0, &zones, &count); 117 | if(error != KERN_SUCCESS) { 118 | return; 119 | } 120 | 121 | for (unsigned i = 0; i < count; i++) { 122 | malloc_zone_t *zone = (malloc_zone_t *)zones[i]; 123 | if (zone == NULL || zone->introspect == NULL){ 124 | continue; 125 | } 126 | 127 | zone->introspect->enumerator(0, ctx, 1, zones[i], task_peek, malloc_zone_enumerator); 128 | } 129 | } 130 | 131 | - (NSSet *)allObjectsOfClass:(Class)cls includeSubclass:(BOOL)shouldIncludeSubclasses { 132 | rc_ctx_t rc_context; 133 | [self initCallbackCtx:&rc_context]; 134 | rc_context->cls = cls; 135 | rc_context->includeSubclass = (boolean_t)shouldIncludeSubclasses; 136 | [self enumerateWithContext:rc_context]; 137 | NSSet *results = [(__bridge NSSet *)(rc_context->results) copy]; 138 | [self destroyCallbackCtx:rc_context]; 139 | return results; 140 | } 141 | 142 | - (void)allObjectsOfClass:(Class)cls includeSubclass:(BOOL)shouldIncludeSubclasses performBlock:(void (^)(id))block { 143 | NSSet *results = [self allObjectsOfClass:cls includeSubclass:shouldIncludeSubclasses]; 144 | for(id i in results) 145 | block(i); 146 | } 147 | 148 | - (void)allObjectsOfClassName:(NSString *)className includeSubclass:(BOOL)shouldIncludeSubclasses performBlock:(void (^)(id))block { 149 | [self allObjectsOfClass:objc_getClass([className UTF8String]) includeSubclass:shouldIncludeSubclasses performBlock:block]; 150 | } 151 | 152 | - (NSSet *)allObjectsOfClassName:(NSString *)className includeSubclass:(BOOL)shouldIncludeSubclasses { 153 | return [self allObjectsOfClass:objc_getClass([className UTF8String]) includeSubclass:shouldIncludeSubclasses]; 154 | } 155 | 156 | @end 157 | -------------------------------------------------------------------------------- /colorfulSidebarX/Plists/icons10.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | /Applications/MacForge.app/Contents/Resources/AppIcon.icns 6 | 7 | /Library/Application Support/MacEnhance 8 | ~/Library/Application Support/MacEnhance 9 | 10 | /Applications/GitHub Desktop.app/Contents/Resources/electron.icns 11 | 12 | /Volumes/Backup/GitHub 13 | ~/GitHub 14 | 15 | /Applications/Google Drive.app/Contents/Resources/GoogleDrive.icns 16 | 17 | ~/Google Drive 18 | 19 | /Applications/App Store.app/Contents/Resources/AppIcon.icns 20 | 21 | cmdGoToApplications 22 | /Applications 23 | ~/Applications 24 | 25 | /Applications/Utilities/Terminal.app/Contents/Resources/Terminal.icns 26 | 27 | ~/bin 28 | 29 | /Applications/iBooks.app/Contents/Resources/iBooksAppIcon.icns 30 | 31 | cmdGoToDocuments 32 | ~/Documents 33 | 34 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/HomeFolderIcon.icns 35 | 36 | cmdGoHome 37 | 38 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AllMyFiles.icns 39 | 40 | cmdGoToAllMyFiles 41 | 42 | /System/Library/CoreServices/Finder.app/Contents/Applications/Computer.app/Contents/Resources/OpenComputerAppIcon.icns 43 | 44 | cmdGoToComputer 45 | 46 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns 47 | 48 | ~/Library/Application Support/MacEnhance/Plugins 49 | /Library/Application Support/MacEnhance/Plugins 50 | 51 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns 52 | 53 | ~/Library/Application Support 54 | 55 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/FullTrashIcon.icns 56 | 57 | SidebarTrash 58 | SidebarTrash-selected 59 | 60 | /System/Library/CoreServices/AppDownloadLauncher.app/Contents/Resources/appStore.icns 61 | 62 | /Applications 63 | ~/Applications 64 | 65 | /System/Library/PreferencePanes/Displays.prefPane/Contents/Resources/Displays.icns 66 | 67 | cmdGoToDesktop 68 | ~/Desktop 69 | 70 | /System/Library/CoreServices/Installer.app/Contents/Resources/Installer.icns 71 | 72 | cmdGoToDownloads 73 | ~/Downloads 74 | 75 | tLib 76 | 77 | cmdGoToUserLibrary 78 | /Library 79 | ~/Library 80 | 81 | tPub 82 | 83 | ~/Public 84 | 85 | tSts 86 | 87 | ~/Sites 88 | 89 | tUtl 90 | 91 | /Applications/Utilities 92 | 93 | idsk 94 | 95 | iDisk 96 | 97 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericNetworkIcon.icns 98 | 99 | cmdGoToNetwork 100 | x-applefinder-vnode:All%E2%80%A6 101 | 102 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/iDiskGenericIcon.icns 103 | 104 | cmdGoToICloud 105 | x-applefinder-vnode:CloudDocs%20libraries 106 | x-applefinder-vnode:iCloud 107 | 108 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AirDrop.icns 109 | 110 | cmdGoToAirDrop 111 | x-applefinder-vnode:AirDrop 112 | AirDrop 113 | 114 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/CDAudioVolumeIcon.icns 115 | 116 | x-applefinder-vnode:Remote%20Disc 117 | 118 | NSMediaBrowserMediaTypeAudio 119 | 120 | ~/Music 121 | NSMediaBrowserMediaTypeAudioTemplate32 122 | 123 | NSMediaBrowserMediaTypePhotos 124 | 125 | ~/Pictures 126 | NSMediaBrowserMediaTypePhotosTemplate32 127 | 128 | NSMediaBrowserMediaTypeMovies 129 | 130 | ~/Movies 131 | NSMediaBrowserMediaTypeMoviesTemplate32 132 | 133 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/SmartFolderIcon.icns 134 | 135 | SidebarSmartFolder 136 | SidebarSmartFolder-selected 137 | 138 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/OpenFolderIcon.icns 139 | 140 | SidebarFolder 141 | SidebarFolder-selected 142 | 143 | ArchiveMailbox.tiff 144 | 145 | SidebarArchive 146 | SidebarArchive-selected 147 | 148 | DraftsMailboxLarge.tiff 149 | 150 | SidebarDrafts 151 | SidebarDrafts-selected 152 | 153 | InMailboxLarge.tiff 154 | 155 | SidebarInbox 156 | SidebarInbox-selected 157 | 158 | junkmail.tiff 159 | 160 | SidebarJunk 161 | SidebarJunk-selected 162 | 163 | logs.png 164 | 165 | LogReports 166 | 167 | pinwheel.png 168 | 169 | SpinReports 170 | 171 | profit.png 172 | 173 | MacAnalytics 174 | 175 | SentMailboxLarge.tiff 176 | 177 | SidebarSent 178 | SidebarSent-selected 179 | 180 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertCautionIcon.icns 181 | 182 | CrashReports 183 | 184 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/com.apple.iphone-x-1.icns 185 | 186 | SidebariPhone 187 | 188 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/com.apple.macbook-retina-space-gray.icns 189 | 190 | SidebarMacBook 191 | 192 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericDocumentIcon.icns 193 | 194 | SidebarGenericFile 195 | 196 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarCustomizeIcon.icns 197 | 198 | cmdGoToUtilities 199 | Diagnostics 200 | 201 | 202 | 203 | -------------------------------------------------------------------------------- /colorfulSidebarX/Plists/icons14.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | /Applications/MacForge.app/Contents/Resources/AppIcon.icns 6 | 7 | /Library/Application Support/MacEnhance 8 | ~/Library/Application Support/MacEnhance 9 | 10 | /Applications/GitHub Desktop.app/Contents/Resources/electron.icns 11 | 12 | /Volumes/Backup/GitHub 13 | ~/GitHub 14 | 15 | /Applications/Google Drive.app/Contents/Resources/GoogleDrive.icns 16 | 17 | ~/Google Drive 18 | 19 | /Applications/App Store.app/Contents/Resources/AppIcon.icns 20 | 21 | cmdGoToApplications 22 | /Applications 23 | ~/Applications 24 | 25 | /Applications/Utilities/Terminal.app/Contents/Resources/Terminal.icns 26 | 27 | ~/bin 28 | 29 | /Applications/Books.app/Contents/Resources/iBooksAppIcon.icns 30 | 31 | cmdGoToDocuments 32 | ~/Documents 33 | 34 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/HomeFolderIcon.icns 35 | 36 | cmdGoHome 37 | 38 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AllMyFiles.icns 39 | 40 | cmdGoToAllMyFiles 41 | 42 | /System/Library/CoreServices/Finder.app/Contents/Applications/Computer.app/Contents/Resources/OpenComputerAppIcon.icns 43 | 44 | cmdGoToComputer 45 | 46 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/KEXT.icns 47 | 48 | ~/Library/Application Support/MacEnhance/Plugins 49 | /Library/Application Support/MacEnhance/Plugins 50 | 51 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns 52 | 53 | ~/Library/Application Support 54 | 55 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/FullTrashIcon.icns 56 | 57 | SidebarTrash-selected 58 | 59 | /System/Library/CoreServices/AppDownloadLauncher.app/Contents/Resources/appStore.icns 60 | 61 | /Applications 62 | ~/Applications 63 | 64 | /System/Library/PreferencePanes/Displays.prefPane/Contents/Resources/Displays.icns 65 | 66 | cmdGoToDesktop 67 | ~/Desktop 68 | 69 | /System/Library/CoreServices/Installer.app/Contents/Resources/Installer.icns 70 | 71 | cmdGoToDownloads 72 | ~/Downloads 73 | 74 | tLib 75 | 76 | cmdGoToUserLibrary 77 | /Library 78 | ~/Library 79 | 80 | tPub 81 | 82 | ~/Public 83 | 84 | tSts 85 | 86 | ~/Sites 87 | 88 | tUtl 89 | 90 | /Applications/Utilities 91 | 92 | idsk 93 | 94 | iDisk 95 | 96 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericNetworkIcon.icns 97 | 98 | cmdGoToNetwork 99 | x-applefinder-vnode:All%E2%80%A6 100 | 101 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/iDiskGenericIcon.icns 102 | 103 | cmdGoToICloud 104 | x-applefinder-vnode:CloudDocs%20libraries 105 | x-applefinder-vnode:iCloud 106 | 107 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AirDrop.icns 108 | 109 | cmdGoToAirDrop 110 | x-applefinder-vnode:AirDrop 111 | AirDrop 112 | 113 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/CDAudioVolumeIcon.icns 114 | 115 | x-applefinder-vnode:Remote%20Disc 116 | 117 | NSMediaBrowserMediaTypeAudio 118 | 119 | ~/Music 120 | NSMediaBrowserMediaTypeAudioTemplate32 121 | 122 | NSMediaBrowserMediaTypePhotos 123 | 124 | ~/Pictures 125 | NSMediaBrowserMediaTypePhotosTemplate32 126 | 127 | NSMediaBrowserMediaTypeMovies 128 | 129 | ~/Movies 130 | NSMediaBrowserMediaTypeMoviesTemplate32 131 | 132 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/SmartFolderIcon.icns 133 | 134 | SidebarSmartFolder-selected 135 | 136 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/OpenFolderIcon.icns 137 | 138 | SidebarFolder-selected 139 | 140 | ArchiveMailbox.tiff 141 | 142 | SidebarArchive-selected 143 | 144 | DraftsMailboxLarge.tiff 145 | 146 | SidebarDrafts-selected 147 | 148 | InMailboxLarge.tiff 149 | 150 | SidebarInbox-selected 151 | 152 | junkmail.tiff 153 | 154 | SidebarJunk-selected 155 | 156 | logs.png 157 | 158 | LogReports 159 | 160 | pinwheel.png 161 | 162 | SpinReports 163 | 164 | profit.png 165 | 166 | MacAnalytics 167 | 168 | SentMailboxLarge.tiff 169 | 170 | SidebarSent-selected 171 | 172 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertCautionIcon.icns 173 | 174 | CrashReports 175 | 176 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/com.apple.iphone-x-1.icns 177 | 178 | SidebariPhone 179 | 180 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/com.apple.macbook-retina-space-gray.icns 181 | 182 | SidebarMacBook 183 | 184 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericDocumentIcon.icns 185 | 186 | SidebarGenericFile 187 | 188 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarCustomizeIcon.icns 189 | 190 | cmdGoToUtilities 191 | Diagnostics 192 | 193 | 194 | 195 | -------------------------------------------------------------------------------- /colorfulSidebarX/Plists/icons9.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/TrashIcon.icns 6 | 7 | ~/.Trash 8 | 9 | tAps 10 | 11 | /Applications 12 | ~/Applications 13 | 14 | tDsk 15 | 16 | ~/Desktop 17 | 18 | tDoc 19 | 20 | ~/Documents 21 | 22 | tDwn 23 | 24 | ~/Downloads 25 | 26 | tLib 27 | 28 | /Library 29 | ~/Library 30 | 31 | tMov 32 | 33 | ~/Movies 34 | 35 | tMus 36 | 37 | ~/Music 38 | 39 | tPic 40 | 41 | ~/Pictures 42 | 43 | tPub 44 | 45 | ~/Public 46 | 47 | tSts 48 | 49 | ~/Sites 50 | 51 | tUtl 52 | 53 | /Applications/Utilities 54 | 55 | idsk 56 | 57 | iDisk 58 | 59 | /System/Library/InternetAccounts/iCloud.iaplugin/Contents/Resources/iCloudSidebar.tiff 60 | 61 | x-applefinder-vnode:CloudDocs%20libraries 62 | x-applefinder-vnode:iCloud 63 | 64 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AirDrop.icns 65 | 66 | x-applefinder-vnode:AirDrop 67 | AirDrop 68 | 69 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/CDAudioVolumeIcon.icns 70 | 71 | x-applefinder-vnode:Remote%20Disc 72 | 73 | /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ToolbarMusicFolderIcon.icns 74 | 75 | NSMediaBrowserMediaTypeAudioTemplate32 76 | 77 | NSMediaBrowserMediaTypePhotos 78 | 79 | NSMediaBrowserMediaTypePhotosTemplate32 80 | 81 | NSMediaBrowserMediaTypeMovies 82 | 83 | NSMediaBrowserMediaTypeMoviesTemplate32 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /colorfulSidebarX/ZKSwizzle/ZKSwizzle.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZKSwizzle.h 3 | // ZKSwizzle 4 | // 5 | // Created by Alexander S Zielenski on 7/24/14. 6 | // Copyright (c) 2014 Alexander S Zielenski. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | // This is a class for streamlining swizzling. Simply create a new class of any name you want and 14 | // Example: 15 | /* 16 | @interface ZKHookClass : NSObject 17 | - (NSString *)description; // hooks -description on NSObject 18 | - (void)addedMethod; // all subclasses of NSObject now respond to -addedMethod 19 | @end 20 | 21 | @implementation ZKHookClass 22 | ... 23 | @end 24 | 25 | [ZKSwizzle swizzleClass:ZKClass(ZKHookClass) forClass:ZKClass(destination)]; 26 | */ 27 | 28 | #ifndef ZKSWIZZLE_DEFS 29 | #define ZKSWIZZLE_DEFS 30 | 31 | // CRAZY MACROS FOR DYNAMIC PROTOTYPE CREATION 32 | #define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL(0, ## __VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5 ,4 ,3 ,2, 1, 0) 33 | #define VA_NUM_ARGS_IMPL(_0, _1,_2,_3,_4,_5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20 ,N,...) N 34 | 35 | #define WRAP0() 36 | #define WRAP1(VARIABLE) , typeof ( VARIABLE ) 37 | #define WRAP2(VARIABLE, ...) WRAP1(VARIABLE) WRAP1(__VA_ARGS__) 38 | #define WRAP3(VARIABLE, ...) WRAP1(VARIABLE) WRAP2(__VA_ARGS__) 39 | #define WRAP4(VARIABLE, ...) WRAP1(VARIABLE) WRAP3(__VA_ARGS__) 40 | #define WRAP5(VARIABLE, ...) WRAP1(VARIABLE) WRAP4(__VA_ARGS__) 41 | #define WRAP6(VARIABLE, ...) WRAP1(VARIABLE) WRAP5(__VA_ARGS__) 42 | #define WRAP7(VARIABLE, ...) WRAP1(VARIABLE) WRAP6(__VA_ARGS__) 43 | #define WRAP8(VARIABLE, ...) WRAP1(VARIABLE) WRAP7(__VA_ARGS__) 44 | #define WRAP9(VARIABLE, ...) WRAP1(VARIABLE) WRAP8(__VA_ARGS__) 45 | #define WRAP10(VARIABLE, ...) WRAP1(VARIABLE) WRAP9(__VA_ARGS__) 46 | #define WRAP11(VARIABLE, ...) WRAP1(VARIABLE) WRAP10(__VA_ARGS__) 47 | #define WRAP12(VARIABLE, ...) WRAP1(VARIABLE) WRAP11(__VA_ARGS__) 48 | #define WRAP13(VARIABLE, ...) WRAP1(VARIABLE) WRAP12(__VA_ARGS__) 49 | #define WRAP14(VARIABLE, ...) WRAP1(VARIABLE) WRAP13(__VA_ARGS__) 50 | #define WRAP15(VARIABLE, ...) WRAP1(VARIABLE) WRAP14(__VA_ARGS__) 51 | #define WRAP16(VARIABLE, ...) WRAP1(VARIABLE) WRAP15(__VA_ARGS__) 52 | #define WRAP17(VARIABLE, ...) WRAP1(VARIABLE) WRAP16(__VA_ARGS__) 53 | #define WRAP18(VARIABLE, ...) WRAP1(VARIABLE) WRAP17(__VA_ARGS__) 54 | #define WRAP19(VARIABLE, ...) WRAP1(VARIABLE) WRAP18(__VA_ARGS__) 55 | #define WRAP20(VARIABLE, ...) WRAP1(VARIABLE) WRAP19(__VA_ARGS__) 56 | 57 | #define CAT(A, B) A ## B 58 | #define INVOKE(MACRO, NUMBER, ...) CAT(MACRO, NUMBER)(__VA_ARGS__) 59 | #define WRAP_LIST(...) INVOKE(WRAP, VA_NUM_ARGS(__VA_ARGS__), __VA_ARGS__) 60 | 61 | // Gets the a class with the name CLASS 62 | #define ZKClass(CLASS) objc_getClass(#CLASS) 63 | 64 | // returns the value of an instance variable. 65 | #if !__has_feature(objc_arc) 66 | #define ZKHookIvar(OBJECT, TYPE, NAME) (*(TYPE *)ZKIvarPointer(OBJECT, NAME)) 67 | #else 68 | #define ZKHookIvar(OBJECT, TYPE, NAME) \ 69 | _Pragma("clang diagnostic push") \ 70 | _Pragma("clang diagnostic ignored \"-Wignored-attributes\"") \ 71 | (*(__unsafe_unretained TYPE *)ZKIvarPointer(OBJECT, NAME)) \ 72 | _Pragma("clang diagnostic pop") 73 | #endif 74 | // returns the original implementation of the swizzled function or null or not found 75 | #define ZKOrig(TYPE, ...) ((TYPE (*)(id, SEL WRAP_LIST(__VA_ARGS__)))(ZKOriginalImplementation(self, _cmd, __PRETTY_FUNCTION__)))(self, _cmd, ##__VA_ARGS__) 76 | 77 | // returns the original implementation of the superclass of the object swizzled 78 | #define ZKSuper(TYPE, ...) ((TYPE (*)(id, SEL WRAP_LIST(__VA_ARGS__)))(ZKSuperImplementation(self, _cmd, __PRETTY_FUNCTION__)))(self, _cmd, ##__VA_ARGS__) 79 | 80 | #define _ZKSwizzleInterfaceConditionally(CLASS_NAME, TARGET_CLASS, SUPERCLASS, GROUP, IMMEDIATELY) \ 81 | @interface _$ ## CLASS_NAME : SUPERCLASS @end \ 82 | @implementation _$ ## CLASS_NAME \ 83 | + (void)initialize {} \ 84 | @end \ 85 | @interface CLASS_NAME : _$ ## CLASS_NAME @end \ 86 | @implementation CLASS_NAME (ZKSWIZZLE) \ 87 | + (void)load { \ 88 | _$ZKRegisterInterface(self, #GROUP);\ 89 | if (IMMEDIATELY) { \ 90 | [self _ZK_unconditionallySwizzle]; \ 91 | } \ 92 | } \ 93 | + (void)_ZK_unconditionallySwizzle { \ 94 | ZKSwizzle(CLASS_NAME, TARGET_CLASS); \ 95 | } \ 96 | @end 97 | 98 | // Bootstraps your swizzling class so that it requires no setup 99 | // outside of this macro call 100 | // If you override +load you must call ZKSwizzle(CLASS_NAME, TARGET_CLASS) 101 | // yourself, otherwise the swizzling would not take place 102 | #define ZKSwizzleInterface(CLASS_NAME, TARGET_CLASS, SUPERCLASS) \ 103 | _ZKSwizzleInterfaceConditionally(CLASS_NAME, TARGET_CLASS, SUPERCLASS, ZK_UNGROUPED, YES) 104 | 105 | // Same as ZKSwizzleInterface, except 106 | #define ZKSwizzleInterfaceGroup(CLASS_NAME, TARGET_CLASS, SUPER_CLASS, GROUP) \ 107 | _ZKSwizzleInterfaceConditionally(CLASS_NAME, TARGET_CLASS, SUPER_CLASS, GROUP, NO) 108 | 109 | __BEGIN_DECLS 110 | 111 | // Make sure to cast this before you use it 112 | typedef id (*ZKIMP)(id, SEL, ...); 113 | 114 | // returns a pointer to the instance variable "name" on the object 115 | void *ZKIvarPointer(id self, const char *name); 116 | // returns the original implementation of a method with selector "sel" of an object hooked by the methods below 117 | ZKIMP ZKOriginalImplementation(id self, SEL sel, const char *info); 118 | // returns the implementation of a method with selector "sel" of the superclass of object 119 | ZKIMP ZKSuperImplementation(id object, SEL sel, const char *info); 120 | 121 | // hooks all the implemented methods of source with destination 122 | // adds any methods that arent implemented on destination to destination that are implemented in source 123 | #define ZKSwizzle(src, dst) _ZKSwizzle(ZKClass(src), ZKClass(dst)) 124 | BOOL _ZKSwizzle(Class src, Class dest); 125 | 126 | #define ZKSwizzleGroup(NAME) _ZKSwizzleGroup(#NAME) 127 | void _$ZKRegisterInterface(Class cls, const char *groupName); 128 | BOOL _ZKSwizzleGroup(const char *groupName); 129 | 130 | // Calls above method with the superclass of source for desination 131 | #define ZKSwizzleClass(src) _ZKSwizzleClass(ZKClass(src)) 132 | BOOL _ZKSwizzleClass(Class cls); 133 | 134 | __END_DECLS 135 | #endif 136 | 137 | -------------------------------------------------------------------------------- /colorfulSidebarX/ZKSwizzle/ZKSwizzle.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZKSwizzle.m 3 | // ZKSwizzle 4 | // 5 | // Created by Alexander S Zielenski on 7/24/14. 6 | // Copyright (c) 2014 Alexander S Zielenski. All rights reserved. 7 | // 8 | 9 | #import "ZKSwizzle.h" 10 | static NSMutableDictionary *classTable; 11 | 12 | @interface NSObject (ZKSwizzle) 13 | + (void)_ZK_unconditionallySwizzle; 14 | @end 15 | 16 | void *ZKIvarPointer(id self, const char *name) { 17 | Ivar ivar = class_getInstanceVariable(object_getClass(self), name); 18 | return ivar == NULL ? NULL : (__bridge void *)self + ivar_getOffset(ivar); 19 | } 20 | 21 | static SEL destinationSelectorForSelector(SEL cmd, Class dst) { 22 | return NSSelectorFromString([@"_ZK_old_" stringByAppendingFormat:@"%s_%@", class_getName(dst), NSStringFromSelector(cmd)]); 23 | } 24 | 25 | static Class classFromInfo(const char *info) { 26 | NSUInteger bracket_index = -1; 27 | for (NSUInteger i = 0; i < strlen(info); i++) { 28 | if (info[i] == '[') { 29 | bracket_index = i; 30 | } 31 | } 32 | bracket_index++; 33 | 34 | if (bracket_index == -1) { 35 | [NSException raise:@"Failed to parse info" format:@"Couldn't find swizzle class for info: %s", info]; 36 | return NULL; 37 | } 38 | 39 | char after_bracket[255]; 40 | memcpy(after_bracket, &info[bracket_index], strlen(info) - bracket_index - 1); 41 | 42 | for (NSUInteger i = 0; i < strlen(info); i++) { 43 | if (after_bracket[i] == ' ') { 44 | after_bracket[i] = '\0'; 45 | } 46 | } 47 | 48 | return objc_getClass(after_bracket); 49 | } 50 | 51 | // takes __PRETTY_FUNCTION__ for info which gives the name of the swizzle source class 52 | /* 53 | 54 | We add the original implementation onto the swizzle class 55 | On ZKOrig, we use __PRETTY_FUNCTION__ to get the name of the swizzle class 56 | Then we get the implementation of that selector on the swizzle class 57 | Then we call it directly, passing in the correct selector and self 58 | 59 | */ 60 | ZKIMP ZKOriginalImplementation(id self, SEL sel, const char *info) { 61 | if (sel == NULL || self == NULL || info == NULL) { 62 | [NSException raise:@"Invalid Arguments" format:@"One of self: %@, self: %@, or info: %s is NULL", self, NSStringFromSelector(sel), info]; 63 | return NULL; 64 | } 65 | 66 | Class cls = classFromInfo(info); 67 | Class dest = object_getClass(self); 68 | 69 | if (cls == NULL || dest == NULL) { 70 | [NSException raise:@"Failed obtain class pair" format:@"src: %@ | dst: %@ | sel: %@", NSStringFromClass(cls), NSStringFromClass(dest), NSStringFromSelector(sel)]; 71 | return NULL; 72 | } 73 | 74 | SEL destSel = destinationSelectorForSelector(sel, cls); 75 | 76 | Method method = class_getInstanceMethod(dest, destSel); 77 | 78 | if (method == NULL) { 79 | [NSException raise:@"Failed to retrieve method" format:@"Got null for the source class %@ with selector %@ (%@)", NSStringFromClass(cls), NSStringFromSelector(sel), NSStringFromSelector(destSel)]; 80 | return NULL; 81 | } 82 | 83 | ZKIMP implementation = (ZKIMP)method_getImplementation(method); 84 | if (implementation == NULL) { 85 | [NSException raise:@"Failed to get implementation" format:@"The objective-c runtime could not get the implementation for %@ on the class %@. There is no fix for this", NSStringFromClass(cls), NSStringFromSelector(sel)]; 86 | } 87 | 88 | return implementation; 89 | } 90 | 91 | ZKIMP ZKSuperImplementation(id object, SEL sel, const char *info) { 92 | if (sel == NULL || object == NULL) { 93 | [NSException raise:@"Invalid Arguments" format:@"One of self: %@, self: %@ is NULL", object, NSStringFromSelector(sel)]; 94 | return NULL; 95 | } 96 | 97 | Class cls = object_getClass(object); 98 | if (cls == NULL) { 99 | [NSException raise:@"Invalid Argument" format:@"Could not obtain class for the passed object"]; 100 | return NULL; 101 | } 102 | 103 | // Two scenarios: 104 | // 1.) The superclass was not swizzled, no problem 105 | // 2.) The superclass was swizzled, problem 106 | 107 | // We want to return the swizzled class's superclass implementation 108 | // If this is a subclass of such a class, we want two behaviors: 109 | // a.) If this imp was also swizzled, no problem, return the superclass's swizzled imp 110 | // b.) This imp was not swizzled, return the class that was originally swizzled's superclass's imp 111 | Class sourceClass = classFromInfo(info); 112 | if (sourceClass != NULL) { 113 | BOOL isClassMethod = class_isMetaClass(cls); 114 | // This was called from a swizzled method, get the class it was swizzled with 115 | NSString *className = classTable[NSStringFromClass(sourceClass)]; 116 | if (className != NULL) { 117 | cls = NSClassFromString(className); 118 | // make sure we get a class method if we asked for one 119 | if (isClassMethod) { 120 | cls = object_getClass(cls); 121 | } 122 | } 123 | } 124 | 125 | cls = class_getSuperclass(cls); 126 | 127 | // This is a root class, it has no super class 128 | if (cls == NULL) { 129 | [NSException raise:@"Invalid Argument" format:@"Could not obtain superclass for the passed object"]; 130 | return NULL; 131 | } 132 | 133 | Method method = class_getInstanceMethod(cls, sel); 134 | if (method == NULL) { 135 | [NSException raise:@"Failed to retrieve method" format:@"We could not find the super implementation for the class %@ and selector %@, are you sure it exists?", NSStringFromClass(cls), NSStringFromSelector(sel)]; 136 | return NULL; 137 | } 138 | 139 | ZKIMP implementation = (ZKIMP)method_getImplementation(method); 140 | if (implementation == NULL) { 141 | [NSException raise:@"Failed to get implementation" format:@"The objective-c runtime could not get the implementation for %@ on the class %@. There is no fix for this", NSStringFromClass(cls), NSStringFromSelector(sel)]; 142 | } 143 | 144 | return implementation; 145 | } 146 | 147 | static BOOL enumerateMethods(Class, Class); 148 | BOOL _ZKSwizzle(Class src, Class dest) { 149 | if (dest == NULL) 150 | return NO; 151 | 152 | NSString *destName = NSStringFromClass(dest); 153 | if (!destName) { 154 | return NO; 155 | } 156 | 157 | if (!classTable) { 158 | classTable = [[NSMutableDictionary alloc] init]; 159 | } 160 | 161 | if ([classTable objectForKey:NSStringFromClass(src)]) { 162 | [NSException raise:@"Invalid Argument" 163 | format:@"This source class (%@) was already swizzled with another, (%@)", NSStringFromClass(src), classTable[NSStringFromClass(src)]]; 164 | return NO; 165 | } 166 | 167 | BOOL success = enumerateMethods(dest, src); 168 | // The above method only gets instance methods. Do the same method for the metaclass of the class 169 | success &= enumerateMethods(object_getClass(dest), object_getClass(src)); 170 | 171 | [classTable setObject:destName forKey:NSStringFromClass(src)]; 172 | return success; 173 | } 174 | 175 | BOOL _ZKSwizzleClass(Class cls) { 176 | return _ZKSwizzle(cls, [cls superclass]); 177 | } 178 | 179 | static BOOL enumerateMethods(Class destination, Class source) { 180 | #if OBJC_API_VERSION < 2 181 | [NSException raise:@"Unsupported feature" format:@"ZKSwizzle is only available in objc 2.0"]; 182 | return NO; 183 | 184 | #else 185 | 186 | unsigned int methodCount; 187 | Method *methodList = class_copyMethodList(source, &methodCount); 188 | BOOL success = YES; 189 | for (int i = 0; i < methodCount; i++) { 190 | Method method = methodList[i]; 191 | SEL selector = method_getName(method); 192 | NSString *methodName = NSStringFromSelector(selector); 193 | 194 | // Don't do anything with the unconditional swizzle 195 | if (sel_isEqual(selector, @selector(_ZK_unconditionallySwizzle))) { 196 | continue; 197 | } 198 | 199 | // We only swizzle methods that are implemented 200 | if (class_respondsToSelector(destination, selector)) { 201 | Method originalMethod = class_getInstanceMethod(destination, selector); 202 | 203 | const char *originalType = method_getTypeEncoding(originalMethod); 204 | const char *newType = method_getTypeEncoding(method); 205 | if (strcmp(originalType, newType) != 0) { 206 | NSLog(@"ZKSwizzle: incompatible type encoding for %@. (expected %s, got %s)", methodName, originalType, newType); 207 | // Incompatible type encoding 208 | success = NO; 209 | continue; 210 | } 211 | 212 | // We are re-adding the destination selector because it could be on a superclass and not on the class itself. This method could fail 213 | class_addMethod(destination, selector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); 214 | 215 | SEL destSel = destinationSelectorForSelector(selector, source); 216 | if (!class_addMethod(destination, destSel, method_getImplementation(method), method_getTypeEncoding(originalMethod))) { 217 | NSLog(@"ZKSwizzle: failed to add method %@ onto class %@ with selector %@", NSStringFromSelector(selector), NSStringFromClass(source), NSStringFromSelector(destSel)); 218 | success = NO; 219 | continue; 220 | } 221 | 222 | method_exchangeImplementations(class_getInstanceMethod(destination, selector), class_getInstanceMethod(destination, destSel)); 223 | } else { 224 | // Add any extra methods to the class but don't swizzle them 225 | success &= class_addMethod(destination, selector, method_getImplementation(method), method_getTypeEncoding(method)); 226 | } 227 | } 228 | 229 | unsigned int propertyCount; 230 | objc_property_t *propertyList = class_copyPropertyList(source, &propertyCount); 231 | for (int i = 0; i < propertyCount; i++) { 232 | objc_property_t property = propertyList[i]; 233 | const char *name = property_getName(property); 234 | unsigned int attributeCount; 235 | objc_property_attribute_t *attributes = property_copyAttributeList(property, &attributeCount); 236 | 237 | if (class_getProperty(destination, name) == NULL) { 238 | class_addProperty(destination, name, attributes, attributeCount); 239 | } else { 240 | class_replaceProperty(destination, name, attributes, attributeCount); 241 | } 242 | 243 | free(attributes); 244 | } 245 | 246 | free(propertyList); 247 | free(methodList); 248 | return success; 249 | #endif 250 | } 251 | 252 | // Options were to use a group class and traverse its subclasses 253 | // or to create a groups dictionary 254 | // This works because +load on NSObject is called before attribute((constructor)) 255 | static NSMutableDictionary *groups = nil; 256 | void _$ZKRegisterInterface(Class cls, const char *groupName) { 257 | if (!groups) 258 | groups = [NSMutableDictionary dictionary]; 259 | 260 | NSString *groupString = @(groupName); 261 | NSMutableArray *groupList = groups[groupString]; 262 | if (!groupList) { 263 | groupList = [NSMutableArray array]; 264 | groups[groupString] = groupList; 265 | } 266 | 267 | [groupList addObject:NSStringFromClass(cls)]; 268 | } 269 | 270 | BOOL _ZKSwizzleGroup(const char *groupName) { 271 | NSArray *groupList = groups[@(groupName)]; 272 | if (!groupList) { 273 | [NSException raise:@"Invalid Argument" format:@"ZKSwizzle: There is no group by the name of %s", groupName]; 274 | return NO; 275 | } 276 | 277 | BOOL success = YES; 278 | for (NSString *className in groupList) { 279 | Class cls = NSClassFromString(className); 280 | if (cls == NULL) 281 | continue; 282 | 283 | if (class_respondsToSelector(object_getClass(cls), @selector(_ZK_unconditionallySwizzle))) { 284 | [cls _ZK_unconditionallySwizzle]; 285 | } else { 286 | success = NO; 287 | } 288 | } 289 | 290 | return success; 291 | } 292 | -------------------------------------------------------------------------------- /colorfulSidebarX/colorfulSidebarX.m: -------------------------------------------------------------------------------- 1 | // 2 | // colorfulSidebarX.m 3 | // colorfulSidebarX 4 | // 5 | // Created by Wolfgang Baird 6 | // Copyright 2016 - 2020 macEnhance. 7 | // 8 | 9 | @import AppKit; 10 | #import "ZKSwizzle.h" 11 | #import "JSRollCall.h" 12 | 13 | static NSDictionary *cfsbIconMappingDict = nil; 14 | struct OpaqueNodeRef; 15 | struct TFENode { 16 | struct OpaqueNodeRef *fNodeRef; 17 | }; 18 | NSInteger macOS; 19 | 20 | @interface colorfulSidebarX : NSObject 21 | @end 22 | 23 | ZKSwizzleInterface(mecsx_MailboxOutlineItemView, MailboxOutlineItemView, NSTableCellView) 24 | @implementation mecsx_MailboxOutlineItemView 25 | 26 | - (void)_updateImage { 27 | ZKOrig(void); 28 | NSImage *replacementImage = cfsbIconMappingDict[self.imageView.image.name]; 29 | if (replacementImage != nil) 30 | [self.imageView setImage:replacementImage]; 31 | } 32 | 33 | @end 34 | 35 | @interface mecsx_NSImageView : NSImageView 36 | @end 37 | 38 | @implementation mecsx_NSImageView 39 | 40 | - (void)setImage:(NSImage *)image { 41 | NSImage *result = image; 42 | if ([image.className isEqualToString:@"NSSidebarImage"]) { 43 | NSImage *replacementImage = cfsbIconMappingDict[image.name]; 44 | if (replacementImage != nil) 45 | result = replacementImage; 46 | } 47 | ZKOrig(void, result); 48 | } 49 | 50 | - (void)layout { 51 | ZKOrig(void); 52 | if (self.class == NSClassFromString(@"TImageView") || self.class == NSClassFromString(@"FI_TImageView")) { 53 | if ([self.superview class] == NSClassFromString(@"TSidebarItemCell") || [self.superview class] == NSClassFromString(@"FI_TSidebarItemCell")) { 54 | [self mecsx_setImage:self.superview]; 55 | } 56 | } 57 | } 58 | 59 | - (void)mecsx_setImage:(id)itemCell { 60 | SEL aSEL = @selector(accessibilityAttributeNames); 61 | if ([itemCell respondsToSelector:@selector(accessibilityAttributeNames)] && [[itemCell performSelector:@selector(accessibilityAttributeNames)] containsObject:NSAccessibilityURLAttribute]) { 62 | NSImage *image = nil; 63 | NSURL *aURL = [itemCell accessibilityAttributeValue:NSAccessibilityURLAttribute]; 64 | if ([aURL isFileURL]) { 65 | NSString *path = [aURL path]; 66 | image = cfsbIconMappingDict[path]; 67 | if (!image) { 68 | aSEL = @selector(name); 69 | if ([itemCell respondsToSelector:aSEL]) { 70 | image = cfsbIconMappingDict[[itemCell performSelector:@selector(name)]]; 71 | } 72 | } 73 | if (!image) { 74 | image = [[NSWorkspace sharedWorkspace] iconForFile:path]; 75 | } 76 | } else { 77 | image = cfsbIconMappingDict[[aURL absoluteString]]; 78 | } 79 | 80 | if (!image) { 81 | aSEL = @selector(image); 82 | if ([itemCell respondsToSelector:aSEL]) { 83 | NSImage *sidebarImage = [self image]; 84 | aSEL = NSSelectorFromString(@"sourceImage"); 85 | if ([sidebarImage respondsToSelector:aSEL]) 86 | sidebarImage = [sidebarImage performSelector:aSEL]; 87 | if ([sidebarImage respondsToSelector:@selector(name)]) 88 | image = cfsbIconMappingDict[[sidebarImage name]]; 89 | } 90 | } 91 | 92 | if (!image) { 93 | Class cls = NSClassFromString(@"FINode"); 94 | if (cls) { 95 | struct TFENode *node = &ZKHookIvar(itemCell, struct TFENode, "_node"); 96 | SEL nodeFromNode = NSSelectorFromString(@"nodeFromNodeRef:"); 97 | id finode = [cls performSelector:nodeFromNode withObject:(__bridge id)node->fNodeRef]; 98 | SEL createAlt = NSSelectorFromString(@"createAlternativeIconRepresentationWithOptions:"); 99 | 100 | NSURL *aURL = [finode valueForKey:@"previewItemURL"]; 101 | if (aURL) 102 | image = cfsbIconMappingDict[[aURL absoluteString]]; 103 | 104 | // Tags 105 | if (!image) 106 | if ([[[self image] representations] count] == 1) 107 | image = [self image]; 108 | 109 | if (!image) { 110 | if ([finode respondsToSelector:createAlt]) { 111 | IconRef iconRef = (__bridge IconRef)[finode performSelector:createAlt withObject:nil]; 112 | image = [[NSImage alloc] initWithIconRef:iconRef]; 113 | ReleaseIconRef(iconRef); 114 | } 115 | } 116 | } 117 | } 118 | 119 | if (image) 120 | [self setImage:image]; 121 | } 122 | } 123 | 124 | @end 125 | 126 | @implementation colorfulSidebarX 127 | 128 | + (NSString*)getPath:(NSString*)appID :(NSString*)iconFile { 129 | NSString *result = [[NSWorkspace.sharedWorkspace absolutePathForAppBundleWithIdentifier:appID] stringByAppendingFormat:@"/Contents/Resources/%@", iconFile]; 130 | if (!result) result = @""; 131 | return result; 132 | } 133 | 134 | + (void)load { 135 | static dispatch_once_t onceToken; 136 | dispatch_once(&onceToken, ^{ 137 | macOS = NSProcessInfo.processInfo.operatingSystemVersion.minorVersion; 138 | 139 | // Set up image dict and swizzle 140 | if (!cfsbIconMappingDict) { 141 | [colorfulSidebarX setUpIconMappingDict]; 142 | ZKSwizzle(mecsx_NSImageView, NSImageView); 143 | NSLog(@"%@ loaded into %@ on macOS 10.%lu", [colorfulSidebarX class], [[NSBundle mainBundle] bundleIdentifier], (unsigned long)macOS); 144 | } 145 | 146 | // Force update NSSidebarImages 147 | JSRollCall *rc = [JSRollCall new]; 148 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 149 | NSSet *imageSet = [rc allObjectsOfClass:NSImageView.class includeSubclass:1]; 150 | for (NSImageView *sbiv in imageSet.allObjects) { 151 | NSImage* sbi = sbiv.image; 152 | if ([sbi.className isEqualToString:@"NSSidebarImage"]) 153 | if (cfsbIconMappingDict[sbi.name] != nil) 154 | [sbiv setImage:sbi]; 155 | } 156 | }); 157 | 158 | // Update Finder Go menu 159 | if ([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.finder"]) { 160 | NSMenu *go = [[[NSApp mainMenu] itemAtIndex:4] submenu]; 161 | for (NSMenuItem *i in [go itemArray]) { 162 | NSString *action = NSStringFromSelector([i action]); 163 | if (action.length > 0) 164 | action = [action substringToIndex:[action length]-1]; 165 | NSImage *image = cfsbIconMappingDict[action]; 166 | if (image != nil) { 167 | [image setSize:NSMakeSize(16, 16)]; 168 | [i setImage:image]; 169 | } 170 | } 171 | } 172 | }); 173 | } 174 | 175 | + (void)setUpIconMappingDict { 176 | NSString *path = [[NSBundle bundleForClass:self] pathForResource:@"icons9" ofType:@"plist"]; 177 | if (macOS > 9) 178 | path = [[NSBundle bundleForClass:self] pathForResource:@"icons10" ofType:@"plist"]; 179 | if (macOS > 13) 180 | path = [[NSBundle bundleForClass:self] pathForResource:@"icons14" ofType:@"plist"]; 181 | NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; 182 | if (!dict) { 183 | cfsbIconMappingDict = [NSDictionary new]; 184 | } else { 185 | NSMutableDictionary *mdict = [NSMutableDictionary dictionaryWithCapacity:0]; 186 | for (NSString *key in dict) { 187 | NSImage *image; 188 | if ([key isAbsolutePath]) { 189 | image = [[NSImage alloc] initWithContentsOfFile:key]; 190 | } else if ([key length] == 4) { 191 | OSType code = UTGetOSTypeFromString((CFStringRef)CFBridgingRetain(key)); 192 | image = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(code)]; 193 | } else { 194 | image = [NSImage imageNamed:key]; 195 | if (image && [key rangeOfString:@"NSMediaBrowserMediaType"].length) { 196 | image = [image copy]; 197 | NSSize size = NSMakeSize(32, 32); 198 | [image setSize:size]; 199 | [[[image representations] lastObject] setSize:size]; 200 | } 201 | } 202 | 203 | // Try expanding ~ 204 | if (image == nil) { 205 | NSString *expandedkey = [key stringByExpandingTildeInPath]; 206 | image = [[NSImage alloc] initWithContentsOfFile:expandedkey]; 207 | } 208 | 209 | // Check if it's a bundle resource 210 | if (image == nil) { 211 | NSString *keyPath = [key stringByDeletingPathExtension]; 212 | NSString *keyExt = [key pathExtension]; 213 | NSString *bundleResource = [[NSBundle bundleForClass:self] pathForResource:keyPath ofType:keyExt]; 214 | image = [[NSImage alloc] initWithContentsOfFile:bundleResource]; 215 | } 216 | 217 | // Fix for 10.15 218 | if (image == nil) { 219 | NSString *sysFix = [@"/System" stringByAppendingString:key]; 220 | image = [[NSImage alloc] initWithContentsOfFile:sysFix]; 221 | } 222 | 223 | if (image) { 224 | NSArray *arr = dict[key]; 225 | NSString *keyName; 226 | for (NSString *key in arr) { 227 | keyName = key; 228 | if ([keyName hasPrefix:@"~"]) { 229 | keyName = [key stringByExpandingTildeInPath]; 230 | } 231 | mdict[keyName] = image; 232 | } 233 | } 234 | } 235 | cfsbIconMappingDict = [mdict copy]; 236 | } 237 | } 238 | 239 | @end 240 | -------------------------------------------------------------------------------- /preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/colorfulSidebar/4e87888030115fe2e1b949375b4f8d57dc6300f1/preview.png --------------------------------------------------------------------------------