Discuss API for Power Management on iOS 4.2 3GS at the iPhone Developer Exchange - Hackint0sh.org; Hey Guys!
I was wondering if there is any private API to control the Power ...
-
API for Power Management on iOS 4.2 3GS
Hey Guys!
I was wondering if there is any private API to control the Power of my
3GS? My girlfriends Sleep Button is broken and I want to code an App
to control the sleep mode programmatically...
I already found out that there is a libIOKit.A.dylib but I don't know how
to implement this into my project.
Is there also a solution to "Turn Off" the Silent/Ring Button and set the phone
to silent mode programmatically? She don't want to jailbreak her device so I
just want to code an App for her.
Best regards,
Traxan
-
-
Super Moderator
Array
You really are making things way harder than they need to be.
You are best off getting the hardware button fixed, this is a relatively cheap option at a non official repair place.
Otherwise, your requirements are met by jailbreak apps and I doubt you will be able to achieve what you want using just the Apple SDK as it often deliberately limits access to system functions like the ones you are asking about.
Activator can wire the "sleep" function to another trigger - it is extremely flexible tool, one of the most useful jailbreak tweaks released so far in my opinion.
There are several tweaks related to the silent/mute button, some of the paid-for tweaks offer the ability to trigger the silent mode based on what events are in your calendar. Search for silen on cydia - you will find quite a few options.
Please read the stickies & search forum before posting!
How to report an iTunes restore/update fail in a useful manner
-
iPad 3G 64GB (4.3.3, Redsn0w) oldest SHSH 3.2.2
iPhone 4 32GB (4.2.1, Redsn0w JB-monte) oldest SHSH 4.1
iPhone 3GS 32GB (4.3.3; Pwnagetool) factory unlocked oldest SHSH 3.1
iPhone 8GB (3.1.3; Pwnagetool) AT&T Locked - Unlocked with bootneuter
-
Did we solve your problem? Got a dollar or two spare ?
Donate!
-
-
Haha yeah I know all these Tools but she don't want to jailbreak her device... I can understand that somehow...
I know that there aren't any public API's or funtctions to do what I want to do. But there must be any API to realize that... Or what have all those Tweakdevelopers done to get there Apps running?
If you know anything about it please let me know!
greez
-
Super Moderator
Array
Appstore developers have demonstrated that they can detect and act on button presses (but ONLY while that specific app is running). See for example the various camera apps that allowed you to snap a picture using the remote button on the apple headphones
Going into sleep mode via an app is probably achievable, but the other item you mentioned, over-riding the behaviour of the ring/silent button... it sounds like you want to do that regardless of which app is active.
These tweak developers mostly rely on mobilesubstrate to achieve these tweaks. This allows them to patch out default behaviour in the running application only (and not change anything on disk)
I'm pretty sure that mobilesubstrate requires specific kernel patches to do it's magic. This kind of stuff isn't possible without jailbreak.
Please read the stickies & search forum before posting!
How to report an iTunes restore/update fail in a useful manner
-
iPad 3G 64GB (4.3.3, Redsn0w) oldest SHSH 3.2.2
iPhone 4 32GB (4.2.1, Redsn0w JB-monte) oldest SHSH 4.1
iPhone 3GS 32GB (4.3.3; Pwnagetool) factory unlocked oldest SHSH 3.1
iPhone 8GB (3.1.3; Pwnagetool) AT&T Locked - Unlocked with bootneuter
-
Did we solve your problem? Got a dollar or two spare ?
Donate!
-
-
OK but you mean that it will be possible to lock or sleep the iPhone programmatically?
Maybe something similar like this:
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
int dimDisplayNow(void) {
io_registry_entry_t r =
IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/IOResources/
IODisplayWrangler");
if(!r) return 1;
int err = IORegistryEntrySetCFProperty(r, CFSTR("IORequestIdle"),
kCFBooleanTrue);
IOObjectRelease(r);
return err;
}
This is like a hack for OSX to force the Display into sleepmode... Like when you put your mouse into the corner and the display turns off.
Do you know any links or something like that to realize that on the phone? Would be so great...
greez
Similar Threads
-
By dawitt in forum Kernel / Kext (Driver) Support
Replies: 0
Last Post: 10-13-2009, 10:45 PM
-
By ThGraf in forum Hardware
Replies: 1
Last Post: 10-12-2009, 03:04 PM
-
By ThGraf in forum Kernel / Kext (Driver) Support
Replies: 0
Last Post: 10-10-2009, 01:25 PM
-
By one4house in forum Kernel / Kext (Driver) Support
Replies: 1
Last Post: 04-25-2009, 06:12 PM
-
By darbid in forum Hardware
Replies: 1
Last Post: 08-02-2008, 08:18 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks