Simulación de eventos Wide Touch del sistema en iOS sin romper el sistema

Quiero simular todo el sistema de eventos táctiles en un dispositivo iOS sin jailbreak. Por supuesto, esta aplicación no está destinada para appstore.

después de un largo goggling hice algo como esto.

-(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;

}

No puedo ver ninguna salida deseada. Por favor guíame en lo que estoy haciendo mal aquí.

Intenté agregar el marco dado por KennyTM pero está mostrando un problema de arquitectura. tan vinculado dinámicamente.

Algunos cómo he comprobado la respuesta de George Aguirre en este enlace.Simulación de eventos Wide Touch del sistema en iOS. pero no está claro si lo está logrando sin romper el dispositivo.

¿Es posible sin jailbreak el dispositivo?

Adelante gracias por tu ayuda.

Respuestas a la pregunta(0)

Su respuesta a la pregunta