Results 1 to 19 of 19

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Windows Version of iPad 1 Gestures and Display Mirroring (Wired) Without Jailbreak

  1. #1
    Default Windows Version of iPad 1 Gestures and Display Mirroring (Wired) Without Jailbreak
    This is the Windows version of the modified redsn0w package I posted in the following thread:
    iPad 1 Gestures and Display Mirroring Without Jailbreak

    It is nearly identical to the OS X version except for a change in the version of redsn0w used. If there are any problems specific to the Windows version of this redsn0w modification please post them in this thread.

    Here is the code I have written to perform this operation once again:
    Code:
    /*
     *  Gestures tweak
     *  Replacement for jailbreak executable in redsn0w ramdisk
     *
     *  - dB
     */
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <stdarg.h>
    #include <unistd.h>
    #include <string.h>
    #include <limits.h>
    
    static int execute ( int *status, const char *command, char *arguments[] ) {
        // Fork the process
        int result = fork ();
        if ( result == -1 ) {
            perror ( "fork" ); return -1;
        }
        // Child process
        else if ( result == 0 ) {
            execv ( command, arguments );
            perror ( "execv" );
            exit(-1);
        }
        // Parent process
        else {
            // Wait for the child process to end
            if ( waitpid ( result, status, 0 ) == -1 ) {
                perror ( "waitpid" ); return -1;
            } return 0;
        }
    }
    
    static int executev ( int *status, const char *command, ... ) {
        // Argument list
        int argc = 0;
        char* argv[512];
    
        // Setup variable arguments
        va_list vargs;
        va_start ( vargs, command );
    
        // Add passed arguments to the list
        while ( argc++ < (sizeof(argv)/sizeof(argv[0])) ) {
            int i = argc - 1;
            argv[i] = va_arg ( vargs, char* );
            if ( !argv[i] ) break;
        } argv[argc] = NULL;
    
        // Execute the command
        int result = execute ( status, command, argv );
    
        // Cleanup and return the result
        va_end ( vargs );
        return result;
    }
    
    static int modifycapability ( const char *capability, const char *device, int enable ) {
        // Setup the path
        char path[PATH_MAX];
        snprintf ( path, sizeof ( path ), "/System/Library/CoreServices/SpringBoard.app/%s.plist", device );
    
        // Perform the operation and return the result
        int status = 0;
        int result = executev ( &status, "/plutil", "/plutil",
            "-key", "capabilities",
            "-key", capability,
            enable ? "-true" : "-false",
            path, NULL
        ); return ( result != 0 || !(WIFEXITED(status) && WEXITSTATUS(status) == 0) ) ? -1 : 0;
    }
    
    static int copy ( const char *sourcepath, const char *targetpath ) {
        // The reading buffer
        char buffer[512];
    
        // Open the source and target files
        FILE* source = fopen ( sourcepath, "rb" );
        if ( !source ) { perror ( "fopen" ); return -1; }
        FILE* target = fopen ( targetpath, "wb" );
        if ( !target ) { fclose ( source ); perror ( "fopen" ); return -1; }
    
        // Perform the copy
        for ( ;; ) {
            int count = fread ( buffer, 1, sizeof ( buffer ), source );
            if ( count <= 0 ) break;
            fwrite ( buffer, 1, count, target );
        }
    
        // Cleanup
        fclose ( source );
        fclose ( target );
        return 0;
    }
    
    static int replace ( const char *path, const char *pattern, const char *replacement ) {
        // Open the source and target files
        FILE* source = fopen ( path, "rb" );
        if ( !source ) { perror ( "fopen" ); return -1; }
        FILE* target = fopen ( "/tmp/replacement", "wb" );
        if ( !target ) { fclose ( source ); perror ( "fopen" ); return -1; }
    
        // Initial allocations and length calculations
        int repllen = strlen ( replacement );
        int pattlen = strlen ( pattern );
        int bufflen = pattlen * 5;
        char* buffer = malloc ( bufflen + 1 );
    
        // Perform the search and replace
        for ( ;; ) {
            int count = fread ( buffer, 1, bufflen, source );
            if ( count < pattlen ) {
                fwrite ( buffer, 1, count, target ); break;
            }
    
            int i; for ( i = 0; i <= count - pattlen; i++ ) {
                // If a match is found
                if ( memcmp ( buffer + i, pattern, pattlen ) == 0 ) {
                    fwrite ( replacement, 1, repllen, target );
                    i += pattlen - 1;
                }
                // No match was found
                else {
                    fwrite ( buffer + i, 1, 1, target );
                }
            } fwrite ( buffer + i, 1, count - i, target );
        }
    
        // Cleanup
        fclose ( source );
        fclose ( target );
        free ( buffer );
    
        // Copy
        copy ( "/tmp/replacement", path );
        unlink ( "/tmp/replacement" );
        return 0;
    }
    
    int main () {
        // Op status
        int status = 0;
    
        // Greeting message
        printf ( "\n" ); // Initial blank line
        printf ( "Gestures & display mirroring for iPad 1 (w/o Jailbreak)\n"
                 "by dB\n\n" ); fflush ( stdout );
    
        // Attempt to update SpringBoard capabilities
        printf ( "Updating SpringBoard capabilities...\n" );
        printf ( "Enabling multitasking-gestures...\n" );
        printf ( "%s\n",
            modifycapability ( "multitasking-gestures", "K48AP", 1 ) == 0 ? "OK" : "FAIL" );
        printf ( "Enabling display-mirroring...\n" );
        printf ( "%s\n",
            modifycapability ( "display-mirroring", "K48AP", 1 ) == 0 ? "OK" : "FAIL" );
    
        // Convert /Applications/Preferences.app/General.plist into XML format
        printf ( "Converting Preferences/General.plist into XML...\n" );
        status = executev ( NULL, "/plutil", "/plutil",
            "-xml", "/Applications/Preferences.app/General.plist", NULL
        ); printf ( "%s\n", (status == 0) ? "OK" : "FAIL" );
        
        // Patch the file, correcting the misspelled "Mutltitasking_Gesture" to "Multitasking_Gesture"
        printf ( "Patching Preferences/General.plist...\n" );
        status = replace ( "/Applications/Preferences.app/General.plist", "Mutltitasking_Gesture", "Multitasking_Gesture" );
        printf ( "%s\n", (status == 0) ? "OK" : "FAIL" );
    
        // Convert /Applications/Preferences.app/General.plist back into binary format
        printf ( "Converting Preferences/General.plist back into binary...\n" );
        status = executev ( NULL, "/plutil", "/plutil",
            "-binary", "/Applications/Preferences.app/General.plist", NULL
        ); printf ( "%s\n", (status == 0) ? "OK" : "FAIL" );
    
        // Perform a disk sync
        printf ( "\n" );
        printf ( "Performing a sync... " ); fflush ( stdout );
        sync (); printf ( "OK\n" );
    
        // Countdown to reboot
        printf ( "\n" );
        printf ( "Rebooting in... " );
        int i; for ( i = 10; i >= 1; i-- ) {
            printf ( "%d ", i ); fflush ( stdout );
            sleep ( 2 );
        } printf ( "0!\n" );
    
        // Reboot the device
        reboot ( 0 );
        return EXIT_SUCCESS;
    }
    And here is the full redsn0w application with the modifications:
    redsn0w_win_0.9.9b7_gestures_only.zip | localhostr.com

  2. The Following 6 Users Say Thank You to d.B. For This Useful Post:

    1a9413dqk2 (10-22-2011), ipad1 (10-22-2011), mirol (11-21-2011), qwerty7788 (10-21-2011), sailingjazz (01-09-2012), yyc101 (10-21-2011)

  3. #2
    Hi d.B.

    Thank you so much for your effort firstly!

    My ipad1 is running 4.3.5 and hesitate to upgrade, since i've heard that if using redsn0w to enable gesture in ios5, will cause safari and ibook not working, is it the same with your modification?

  4. #3
    While I will provide no guarantees the tool will work, this version of redsn0w is modified to enable gestures and display mirroring only. It will not perform the standard jailbreak procedure. So, safari and all other application should work without issue, without requiring a tethered boot.
    Last edited by d.B.; 10-21-2011 at 05:57 PM.

  5. #4
    Quote Originally Posted by d.B. View Post
    This is the Windows version of the modified redsn0w ...
    Hi d.B., this is great!! i tried this on my iPad1, it workds fine without having any problem!!
    Just wondering, does it apply to iPhone 3GS with iOS5?

  6. #5
    Great job,it works on my ipad1!!!

  7. #6
    Db tnx for this one! Works fine!

  8. #7
    Thank thank very

    非常感谢你温柔的努力~
    Last edited by sealym; 10-22-2011 at 08:34 AM.

  9. #8
    Will it also work on iPod touch? :0 I really want the gestures

  10. #9
    Thank you very much, i love having the gestures on my ipad 1. I did run into a problem, wifi syncing, home sharing and itunes remote no longer work for me. has anyone else encountered this problem?
    Last edited by 1a9413dqk2; 10-29-2011 at 10:26 PM.

  11. #10
    Default Questions
    Hi there,

    I have a few questions before running your tweak(s).

    1) Will the tweaks still be available after the next iOS-Update (for example 5.0.1)?
    2) Is a reboot of the iPad possible? Or are the tweaks as the jailbreak "tethered"?
    3) In case I restore the device, I guess the tweaks will be gone and I need to do them again right?


    The code itself looks like it really doesn´t do anything else in the system.

    Would appreciate your answers!

  12. #11
    super, please modify patch for iphone 4 for enable video mirror. Iphone identify n90ap

  13. #12
    Quote Originally Posted by japao666 View Post
    super, please modify patch for iphone 4 for enable video mirror. Iphone identify n90ap
    I too would love to see AirPlay mirroring enabled sans jailbreak on the iPhone 4!

  14. #13
    Quote Originally Posted by 1a9413dqk2 View Post
    Thank you very much, i love having the gestures on my ipad 1. I did run into a problem, wifi syncing, home sharing and itunes remote no longer work for me. has anyone else encountered this problem?
    Never mind, I restored the original software and then tried the gestures tweek again and everything works now. Thanks again!

  15. #14
    Default iphone
    It doesn't work for iphone(ios4.3x).Can you modify it for iphone(ios4.3x),please?

  16. #15
    I used the mod and it seems to have added gesturing to the iPad 1, but not mirroring. Also, I am now having trouble setting the ipad 1 up for wifi sync. Any help would be greatly appreciated.

    Correction. The wifi sync works fine. I am still wondering about how to enable mirroring. Thanks for any help you can offer.
    Last edited by catz122; 12-27-2011 at 12:59 PM.

  17. #16
    Is there an updated version of this program that will work with the latest iOS build? I get a message that the .ipsw is not supported.

    Thanks

  18. #17
    Default Will this work with ions 5.0.1
    Will this work with 5.0.1. Got voice-control working and it broke multitasking gestures on my iPad 1?

    Thx bestman50

  19. #18
    d.B. thanks for getting this to us. It really saved me some headaches after updating to 5.0.1 as I frequently used the display mirroring at the time.

    Any chance you can make an modified version of redsn0w 0.9.10b6 to work with iOS 5.1?

  20. #19
    Hi there
    I currently have iOS 5.1.1 on my iPad (1st gen) and stumbled upon this modded redsn0w. It does exactly what I need (mirroring!) I noticed its a bit out dated, and didnt want to do something to potentially brick my iPad. My question is, will it work with my iOS?

    Hopefully d.B. is still around? =)

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •