Simulieren von systemweiten Berührungsereignissen unter iOS ohne Jailbreak des Geräts

Ich möchte systemweit Touch-Ereignisse in einem Gerät ohne Jailbreak simulieren. Natürlich ist diese App nicht für den Appstore gedacht.

Nach einer langen Brille habe ich so etwas gemacht.

-(void) SimulateTouchEvent
{
    float x = ((arc4random()%RAND_MAX)/(RAND_MAX*1.0))*(320.0-1.0)+1.0;
    float y = ((arc4random()%RAND_MAX)/(RAND_MAX*1.0))*(480.0-1.0)+1.0;
    static int click = 0;
    void *lib = dlopen(GSSERVPATH, RTLD_LAZY);
    uint64_t (*GSCurrentEventTimestamp)() = (uint64_t(*)())dlsym(lib, "GSCurrentEventTimestamp");
    mach_port_t (*GSGetPurpleApplicationPort)() = (mach_port_t(*)())dlsym(lib, "GSGetPurpleApplicationPort");
    //  void GSSendEvent(const GSEventRecord* record, mach_port_t port);
    void (*GSSendEvent)(const GSEventRecord* record, mach_port_t port) = (void(*)(const GSEventRecord* record, mach_port_t port)) dlsym(lib, "GSSendEvent");
    //void GSSendSystemEvent(const GSEventRecord* record);
    void (*GSSendSystemEvent)(const GSEventRecord* record) = (void(*)(const GSEventRecord* record)) dlsym(lib, "GSSendSystemEvent");

    static int prev_click = 5;

    CGPoint location = {x, y};

    // structure of touch GSEvent
    struct GSTouchEvent 
    {
        GSEventRecord record;
        GSHandInfo    handInfo;
    } * event = (struct GSTouchEvent*) &touchEvent;
    bzero(touchEvent, sizeof(touchEvent));

    // set up GSEvent
    event->record.type = kGSEventHand;
    event->record.windowLocation = location;
    event->record.timestamp = GSCurrentEventTimestamp();
    event->record.infoSize = sizeof(GSHandInfo) + sizeof(GSEventRecord /*GSPathInfo*/);
    event->handInfo.type = (GSHandInfoType)click; //getHandInfoType(prev_click, click);

    event->handInfo._0x44 = 0x1;
    event->handInfo._0x48 = 0x1;        

    event->handInfo.pathInfosCount = 1;
    bzero(&event->handInfo.pathInfos[0], sizeof(GSPathInfo));
    event->handInfo.pathInfos[0].pathIndex     = 2; //1;
    event->handInfo.pathInfos[0].pathIdentity  = 2;
    event->handInfo.pathInfos[0].pathProximity = click ? 0x02 /*0x03*/ : 0x01 /*0x00*/;
    event->handInfo.pathInfos[0].pathLocation  = location;

    // send GSEvent
    //sendGSEvent( (GSEventRecord*) event, location);    
    //mach_port_t pPort = GSGetPurpleApplicationPort();
    //GSSendEvent((GSEventRecord*) event, pPort);
    GSSendSystemEvent(&event->record);


    prev_click ^= click;
    click ^= prev_click;
    prev_click ^= click;

}

Ich kann keine gewünschte Ausgabe sehen. Bitte führe mich, was ich hier falsch mache.

Ich habe versucht, ein von KennyTM bereitgestelltes Framework hinzuzufügen, aber es zeigt ein Architekturproblem. so dynamisch verknüpft.

Einige, wie ich George Aguirre Antwort in diesem Link überprüftSimulieren von systemweiten Berührungsereignissen unter iOS. aber nicht klar, ob er dies erreicht, ohne das Gerät Jailbreak.

Ist ohne Jailbreak das Gerät möglich?

Vorab vielen Dank für Ihre Hilfe.

Antworten auf die Frage(0)

Ihre Antwort auf die Frage