The ModMyTM Family of Sites:
ModMyMotoModMyiModMyGphone




 
 
Register or Connect with Facebook

Discuss AppStore Apps | Browse / Search Cydia | MMi Cydia Stats




  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > iPhone / iPod Touch SDK | Development Discussion
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 03-23-2009, 04:44 PM
Developer
 
Join Date: Feb 2008
Device + Firmware: iPhone | 1.1.4
Operating System: Vista | Leopard | Ubuntu
Posts: 14
Thanks: 0
Thanked 7 Times in 2 Posts
MobileSubstrate Dylib Template for Xcode. Bam.

Well, if you're anything like me, then you are absolutely sick of compiling MobileSubstrate plugins on your phone. There are reasons, and they all are bothersome. In fact, MobileSubstrate plugins are the last thing I was stuck compiling on my phone.

So, I fixed that. By adding the SpringBoard headers to the appropriate places on my computer and adding libsubstrate to my build environment. [Of course, I also compiled it on my computer so I could compile and run MS plugins for the simulator]

Which in itself would have been fine, except for the fact that Xcode doesn't want to compile dylibs for the iPhone. It will actively refuse to if you select "Build a dylib" and change the SDK to any iPhone SDK. Instead, you have to tell Xcode that you're compiling an application and set the dylib flags yourself. Then, take the application you've created, rename the binary, and discard the rest of the .app. Doing all that just was a waste of time.

So, I put together a little template in xcode that will do most of what I want for me. I won't go on and on, as this is just a template, but it is a fantastic starting point for building a dylib, as templates should be. This will build the dylib and sets your first hook into SpringBoard.

Unfortunately, you still have to rename the binary and discard the rest of the package (as xcode won't compile any other way). Also, don't forget to run ldid on the resulting dylib.

Template: http://www.touchrepo.com/SampleCode/...trateDylib.zip
Place the contents of that zip in /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Project Templates/Application


Note, this does require set up. The template assumes that your SpringBoard headers are all in order and are set up and ready to go in the standard header location. If they are not, then take this time to add the SpringBoard headers to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include/SpringBoard/ etc, all the way up to the 2.2.1 SDK (for 3.0, class-dump the 3.0 SpringBoard and place those in the 3.0.sdk's include directory). Do the same for all the Simulator SDKs if you wish to also compile MS plugins for the Simulator. The smart coder would use symlinks whenever possible here.

Next, you will need to get a copy of libsubstrate from off of your phone. Copy that to /Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/ If you have also compiled libsubstrate for yourself (for the simulator), place that in the Simulator's equivalent location.


Once your headers and libraries are in place, go ahead select a "New Project" in Xcode and compile. You should now have an app. Again, append a dylib to that binary and discard the rest of the app bundle.

Place the dylib on your phone in /Library/MobileSubstrate/DynamicLibraries, run ldid -S your.dylib, and respring!

Enjoy!
Attached Files
File Type: zip MobileSubstrate Dylib.zip (479.1 KB, 65 views)

Last edited by SkylarEC; 03-23-2009 at 04:55 PM..
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #2  
Old 03-23-2009, 04:48 PM
him121213's Avatar
BanHammr Immune
 
Join Date: Oct 2008
Device + Firmware: iPhone 3GS (White) 3.0 JB/Unlocked
Operating System: Mac OS X 10.5.8 (Leopard)/Fedora 10/FreeBSD 7.1/Debian 5.0
Location: Buffalo
Posts: 2,239
Thanks: 72
Thanked 229 Times in 194 Posts
Send a message via AIM to him121213 Send a message via MSN to him121213 Send a message via Yahoo to him121213 Send a message via Skype™ to him121213

AWSOME!!! great job... that is going to be so much easier
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
Reply

  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > iPhone / iPod Touch SDK | Development Discussion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Go to Top
ModMyI

All times are GMT -6. The time now is 02:23 PM. Powered by vBulletin® Version 3.8.4
If you need Dedicated Server Hosting, you should check out SingleHop. | Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 Copyright © 2007-09 by ModMy, LLC. All rights reserved.

iPhone News / iPhone Forums / Apple News / Apple Forums / RSS / Contact Us / / Privacy Statement / Top