Desktop Complete Customization for your Dock on Mountain Lion

Discussion in 'UI Customization' started by unsanity77, Nov 24, 2012.

Thread Status:
Not open for further replies.
  1. unsanity77, Nov 24, 2012
    Last edited: May 22, 2013

    macrumors member

    unsanity77

    Joined:
    Nov 22, 2012
    #1
    UPDATE: Full-featured app for more than just black -- http://spyresoft.com


    Here's something I came up with to help those who absolutely have to have a black dock. Since Apple moved from image files to CoreGraphics rendering code, the only way to customize the color of the dock is to modify the code.

    So.... I've written a program that will patch the Dock's code. It performs a static decryption on the Dock binary, patches several offsets, and removes an integral part of the code signature to bypass the signing process.

    This is no longer considered BETA software. It has stood the test of time, and hundreds of users have reported success, with no failures.

    However, I have created an actual cocoa app in an effort to make it even easier for most people to use. This app is considered BETA for now. There is no functional difference between the command-line version and the GUI version, so if you've already modified your dock, there's no need to download the new version (unless you want to BETA test it). This app will ask for your password to install a helper app. This helper app is so that changes can be made to the Dock app (which is owned by the "root" user). If you ever want to uninstall, remove the following files:

    Code:
    /Library/LaunchDaemons/com.chasingsilver.dpprivilegedhelper.plist
    /Library/PrivilegedHelperTools/com.chasingsilver.dpprivilegedhelper
    

    To use the command-line dock mod,
    Code:
    usage:
        dockmod -c <color> -r
    
        -c, --color            color to make the dock ('default' or 'black')
        -r, --noreflections    disable icon reflections
    
    Keep in mind, again, this will only work for 10.8.2 so far, and will have to be updated for future versions. Success has been reported also for 10.8.3.

    use it like this:
    Code:
    sudo dockmod -c black -r
    
    The color options are "black" and "default" for the -c option, and the -r option will disable icon reflections.

    This is what it looks like:
     

    Attached Files:

  2. macrumors 6502

    Joined:
    Jun 22, 2010
    #2
    The dock executable contains the mission control code also. Any chance you found any adjustable attributes? For example - decrease amount of empty space between the windows in Mission Control.


    Great work on the Dock theming. Somebody is going to take your idea and sell it as an app if you are not careful :)
     
  3. thread starter macrumors member

    unsanity77

    Joined:
    Nov 22, 2012
    #3
    I didn't look for mission control code, but if it's in there I could probably find it.

    And this way is fairly complicated, unportable across minor OS versions, and easily broken but if someone wants to try to sell it, I suppose there's no way to stop them!
     
  4. macrumors 603

    bedifferent

    Joined:
    Jan 8, 2009
    Location:
    NY
    #4
    Thanks again for all your help in the other thread.

    I have the latest Xcode 4.x Beta (iOS developer), and I didn't install the command line tools.

    Once done, I should be able to call 'gdb', currently it's unrecognized in Terminal, which may have been the issue (I used a work around that didn't take).

    Thanks mate! :)
     
  5. thread starter macrumors member

    unsanity77

    Joined:
    Nov 22, 2012
    #5
    Ahh yes, thanks for pointing that out! Will edit the original post to reflect this.
     
  6. macrumors 603

    bedifferent

    Joined:
    Jan 8, 2009
    Location:
    NY
    #6
    Last ?, after dumping binary, terminal claims gdb is still running and should I quit. Is it still working in the background and should I wait until it is done or just quit? Thanks!
     
  7. thread starter macrumors member

    unsanity77

    Joined:
    Nov 22, 2012
    #7
    Screenshot so I can see what you typed.
     
  8. macrumors 603

    bedifferent

    Joined:
    Jan 8, 2009
    Location:
    NY
    #8
    There you go :)
     

    Attached Files:

  9. unsanity77, Nov 24, 2012
    Last edited: Nov 24, 2012

    thread starter macrumors member

    unsanity77

    Joined:
    Nov 22, 2012
    #9
    You can just quit anyway there ;)

    Remember when you paste in this dumped code in 0xED to make sure that you're pasting starting at offset 0 and that you're write mode is overwrite.

    You can also just use this command to copy the dumped code from the dump file on your desktop to the Dock binary also on your desktop:
    cat ~/Desktop/dump | dd of=~/Desktop/Dock bs=1 seek=0 count=`stat -f %z ~/Desktop/dump` conv=notrunc
     
  10. macrumors newbie

    Joined:
    Nov 24, 2012
    #10
    Hi, I' ve just finished following the guide but I' ve got a "strange" result as you can see from the two screenshots attached. Basically the dock becomes kinda grey when I have any window open and takes the background color when I have none open so I guess that has to do with some opacity/reflection settings. I' ve checked all the values I' ve inserted in 0xED and they are correct(I guess)...any suggestions? :)
     

    Attached Files:

  11. thread starter macrumors member

    unsanity77

    Joined:
    Nov 22, 2012
    #11
    You'll remember that even the original Dock reflected windows that were above it. It's because the background of the Safari window is a bright white, and that's being reflected in the glossy black dock, and so it becomes a gray color. Try a website with a darker background color or make the window smaller and move it closer and then away from the dock to see what I mean.

    With that said, your dock does seem a bit different. Are you sure you left the Dock Alpha Transparency Value unchanged?

    I to would like to change this reflection type too, and I'll take a look at it again probably in the coming weekends and post my result.
     
  12. macrumors member

    Joined:
    Jun 4, 2012
    #12
    Yeah, please find out what kind of tweaks one can perform to Mission Control, pleeeeeaaase! :D

    ----------

    The dock reflects the whatever is above it. So if you have a mostly white window open, the dock is going to look white/grey. If you close all windows it'll only reflect your desktop. Try scrolling a window and see if you can catch the movement in the dock reflection! :)
     
  13. Wich, Nov 25, 2012
    Last edited: Nov 25, 2012

    macrumors newbie

    Joined:
    Nov 24, 2012
    #13
    Yeah, but with the original dock the effect was more subtle(as it stayed always kinda grey) while here I have a dock that goes from grey for example all the way to completely green/red if I put a completely green/red background when I have no windows open. I would really love a dock that stays always black regardless of any windows open/background. As for the Dock Alpha Transparency value I didn' t touch it and it has this value for me: 00 00 00 00 00 00 F0 3F...:)
    edit: Btw I just noticed that the stacks on the dock are "broken"(they don' t display the correct items anymore)...
     
  14. symo, Nov 25, 2012
    Last edited: Nov 25, 2012

    macrumors newbie

    Joined:
    Nov 7, 2008
    Location:
    Italy
    #14
    I did as you said in the other thread, but the md5 is still different from yours.
    I tried the hack ad obviously it didn't work, the dock became gray with colored reflections depending on the wallpaper (or the currently open window).
    [​IMG]
    I'm afraid I'll have to give up. :(
    Thank you anyway.
     
  15. thread starter macrumors member

    unsanity77

    Joined:
    Nov 22, 2012
    #15
    Actually, from the picture, it appears that you were successful in patching the dock. The dock always reflects the wallpaper or the windows directly above it. It's just more noticeable now that it's black. However, I'll still be looking for a way to "tone down" this reflective behavior, and it will most likely result in just a couple more offsets to patch.
     
  16. macrumors newbie

    Joined:
    Nov 7, 2008
    Location:
    Italy
    #16
    I thought the hack hadn't worked because in your picture the dock looked darker, but now I guess it's because of the black wallpaper.
    Very well then.
    Thanks!:)
     
  17. unsanity77, Nov 25, 2012
    Last edited: Nov 26, 2012

    thread starter macrumors member

    unsanity77

    Joined:
    Nov 22, 2012
    #17
    EDIT: As these are the only stable patches for now, I've updated the guide in post #1 to reflect these new patches/offset.

    Alright, thanks to everyone for giving this a whirl. I've realized that changing constant float values in memory has led to unintended consequences, since these values are also being used elsewhere in the program. So I have localized the changes to black to the rendering function. However, by doing this, you cannot play around with the colors. Your dock is either black, or it's the original color. For those of you who would like to give this a try, I'm including the offsets you should patch here.

    These offsets are used INSTEAD OF the ones listed in the document I uploaded. So essentially, you'd need to start with the original Dock binary, and do the steps again, except this time only patch what's listed here in this post. I've included pictures for you to see what it looks like now.


    Patch 0xDC0AD to 0F 57 C0
    Patch 0xDC0C8 to 0F 57 C0 90 90 90 90 90
    Patch 0xDC0ED to 0F 57 C0 90 90 90 90 90
    Patch 0xDC19F to 0F 57 C0 90 90 90 90 90
    Patch 0xDC1C7 to 0F 57 C0 90 90 90 90 90
    Patch 0xDC26D to 0F 57 C0
    Patch 0xDC31D to 0F 57 C0 90 90 90 90 90

    Patch 0xAC to 00 (so kernel doesn't attempt to decrypt what's already decrypted)

    And you can still disable the icon reflections by patching 0x12EB2 to 00 as well (though I think that looks weird now).

    As you can see from the pictures, it tends to look better with the lighter or colored backgrounds. Not so distinguishable when you have a darker gray/almost black background. YMMV.
     

    Attached Files:

  18. symo, Nov 26, 2012
    Last edited: Nov 26, 2012

    macrumors newbie

    Joined:
    Nov 7, 2008
    Location:
    Italy
    #18
    I like it a lot. :)
    [​IMG]
    Thank you so much!!!
     
  19. Mal
    macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #19
    I started to attempt this, but not having any programming experience, I discovered I'm not up to the task. Is there any way someone could post the Dock.app and just let me do the code signing and place it in the proper location? I can handle that part.

    jW
     
  20. macrumors 603

    bedifferent

    Joined:
    Jan 8, 2009
    Location:
    NY
    #20
    Worked like a charm! Thanks so much for your hard work and help. :)

    The developers of "Candybar" over at Panic should read this as it may benefit them in allowing OS X 10.8 Dock modification. Since the change, dock modding is no longer functional in the application, hence Candybar decided on making the application free.
     
  21. thread starter macrumors member

    unsanity77

    Joined:
    Nov 22, 2012
    #21
    Any one else reading this can refer to the original post #1 to download an automatic patcher. This should simplify things for those not comfortable with all the steps outlined in the tutorial. However, keep in mind that at this point, you will be a beta tester... muahahaha ;)

    If there's anything wrong with it, I'll update what I can.

    And honestly, this is an extremely hacky method that I would doubt could be incorporated into CandyBar.
     
  22. macrumors 603

    bedifferent

    Joined:
    Jan 8, 2009
    Location:
    NY
    #22

    After I wrote that comment I realized sandboxing and other "hacks" would be outside of the allowed parameters. Prior to 10.8, modding the Dock required replacing the frontline and s-curve png's. As the Dock is more "interactive", using Candybar's method of replacing the icons and images isn't possible and you are right, I doubt it would be in their best interest.

    However, YOU could make some money! Your work is the only method I have tried since 10.8 DP2 or 3 that works. I know many who would gladly pay for an easy app.
     
  23. thread starter macrumors member

    unsanity77

    Joined:
    Nov 22, 2012
    #23
    I probably could, but I'm not really interested in that. I did it because it's fun. And as many people as you know who would gladly pay for an easy app, I bet I know more who would gladly have that app for free! In any case, the "software" is now free at the top of this page. =D

    But thanks, I'm sure glad you find it useful.
     
  24. macrumors 603

    bedifferent

    Joined:
    Jan 8, 2009
    Location:
    NY
    #24
    A scholar and a gentleman. I'm much the same, I enjoy the process and helping others. Thank you again.
     
  25. TheAngryPenguin, Nov 26, 2012
    Last edited: Nov 26, 2012

    macrumors member

    TheAngryPenguin

    Joined:
    Oct 1, 2012
    #25
    Thanks for putting together the automatic patcher. I am, however, unable to get it to work properly. I had been using another 'hack' (outlined here), but I reverted to Dock.app v.10.8.2 from a backup before attempting to run the auto-patcher. Here's the output:

    Code:
    $ sudo ./patch_dock 
    Backing up original Dock contents
    Dumping memory from Dock (5263) [0x104eda000-0x105135000]
    Copying Dock binary to working directory
    Replacing encrypted contents with decrypted dump
    Patching __TEXT segment flags
    Patching offset 0xDC0AD
    Patching offset 0xDC0C8
    Patching offset 0xDC0ED
    Patching offset 0xDC19F
    Patching offset 0xDC1C7
    Patching offset 0xDC26D
    Patching offset 0xDC31D
    Importing code signing certificates
    Replacing with patched Dock
    Code signing the patched Dock
    /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: replacing existing signature
    /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: object file format unrecognized, invalid, or unsuitable
    Restarting the Dock process
    The Dock process cannot successfully restart, and my wallpaper disappears. Reverting seems to work. Also, if I run the revert_to_original script, and then run the patch_dock script, I get the same results listed above. Any ideas?

    Update: After realizing the the scripts already include the sudo command, I tried running them w/o it. Same result.
     
Thread Status:
Not open for further replies.

Share This Page