Simulate all physical buttons like the pressure on the home button on iOS 7 (Jailbreak)
Asked Answered
S

2

7

I'm trying to simulate the "home button pressed" on iOS 7 but the previous method used on iOS 6 doesn't work. I speak of course of a jailbroken device.

#include "GSEvent.h"

    - (void)simulateHomeButton
    {
       struct GSEventRecord record;
       memset(&record, 0, sizeof(record));
       record.type = kGSEventMenuButtonDown;
       record.timestamp = GSCurrentEventTimestamp();
       GSSendSystemEvent(&record);
       record.type = kGSEventMenuButtonUp;
       GSSendSystemEvent(&record);
    }

*UPDATE What I really need is a generic method like the old one that let me to simulate the pressure of all physical buttons

Stapleton answered 8/1, 2014 at 14:25 Comment(0)
M
6

Try this.

[[%c(SBUIController) sharedInstance]clickedMenuButton];

Metralgia answered 13/1, 2014 at 4:26 Comment(6)
Thanks It works. But I can't simulate the double tap to call the BackGround app Switcher for example... What a really need is a generic method like the old one that let me to simulate the pressure of all physical buttonsStapleton
I think this method only work on UI level, can not simulate hardware level's action. For double tap, you can try this, [[SBUIController sharedInstance] handleMenuDoubleTap];Metralgia
Yes it works ... I already found that yesterday night.. :) what I miss now is only a method to lock the device ;) have you got some hints ? ThanksStapleton
[[%c(SBUserAgent) sharedUserAgent] lockAndDimDevice]Metralgia
@guoc, thank you, but how can I simulate volume button click events?Cyrstalcyrus
Hey @Suge, did you find a way to simulate volume button clicks ? I know it's old but we never know 😃Ephemerality
S
0

I found some references to homeButtonPress in the header dumps of BiometricKit https://github.com/MP0w/iOS-Headers/blob/6e220684809a8e581357c1622efcc002a1df5014/iOS7/PrivateFrameworks/BiometricKit/BiometricKit.h#L68

Suppositive answered 11/1, 2014 at 2:1 Comment(2)
Yes, but What I need is a generic method like the old one that let me to simulate the pressure of all physical buttons ;)Stapleton
Based on which framework this is in, and the name of the method, I would say that this is a callback that gets invoked when the home button is pressed. Not a button that creates a home button press event.Nomism

© 2022 - 2024 — McMap. All rights reserved.