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 01-06-2009, 04:41 AM
What's Jailbreak?
 
Join Date: Jan 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Execute shell command

Hi, In a jailbreak 2.2 iPhone is it possible execute inside an objective-c app a system Script or a system command as: cp, mv, etc with root credential?

Please help me!
Many thanks!
By TeoG

Transfer TeoG Page
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #2  
Old 01-06-2009, 11:25 PM
NetMage's Avatar
Developer
 
Join Date: Aug 2007
Device + Firmware: iPhone 2.2.0
Operating System: Windows XP / OS X
Location: Virginia
Posts: 1,231
Thanks: 45
Thanked 202 Times in 162 Posts

Des.

The recommended method is to create helper applications that execute your privileged tasks, and are installed with setuid bit and owner set as root. When your program calls the helper, it will run as root.

Alternatively, you can have your application installed with setuid bit and owner set as root. This can create problems with user preferences, etc, as the iPhone OS will think your application is running as root (i.e. your home dir is /private/var/root, etc.).

Last edited by NetMage; 01-06-2009 at 11:44 PM..
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #3  
Old 01-07-2009, 04:30 PM
What's Jailbreak?
 
Join Date: Jan 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

Many thanks for your good informations!

What kind of API can I use to start helper app inside main app?

system(path_of_helper_app);

could be work?

by
Matteo
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #4  
Old 01-07-2009, 05:47 PM
NetMage's Avatar
Developer
 
Join Date: Aug 2007
Device + Firmware: iPhone 2.2.0
Operating System: Windows XP / OS X
Location: Virginia
Posts: 1,231
Thanks: 45
Thanked 202 Times in 162 Posts

I think system() is probably your best bet... though I haven't done this
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 01:07 AM. 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