iosiphonevb.netjailbreak

Import a folder with files inside into a jailbroken iPhone using vb.net


I am writing an app in VB.NET (Visual Studio 2013) and as a final step, it has two copy a folder (with several files inside) into a certain directory in an iPhone.

The iPhone is jailbroken so it is possible to access every kind of directory and it should also be connected to the PC via USB. Is this even possible?


Solution

  • I can tell you how you would do this programmatically:

    First, you need to tunnel SSH over USB. You can do that by programatically executing itunnel_mux.exe from this zip.(you'll have to extract everything first.) Use it like this:

    itunnel_mux.exe --tunnel -iport 22 -lport 2222
    

    Then, you can use SCP (I'd recommend this library) to Copy files over from root@127.0.0.1:2222 (password alpine).

    This is some example pseudocode:

    'Extract the exe and dll file from that zip
    extract_files()
    'I'm making a new variable containing the port number. 
    Dim port As string = "2222"
    'I made up this function. Lets pretend it executes Batch code in the current directory (like a bat file)
    execbat("itunnel_mux.exe --tunnel -iport 22 -lport " + port)
    Using scp As New Rebex.Net.Scp
        ' connect to a server
        scp.Connect(hostname)
        ' authenticate (change alpine if you changed your root passwd)
        scp.Login("root", "alpine")
    
        ' Here, you can use "scp" to upload and download files
        scp.PutFile("C:\Users\KevinKZ\Desktop\fileToUpload.jpg", "/var/mobile/Documents/fileToUpload.jpg")
        scp.GetFile("/var/mobile/Library/SMS/sms.db", "C:\Users\KevinKZ\Desktop\SMS_Backups\2-1-14.db")
        scp.Disconnect()
    End Using
    

    This solution is far from elegant. It also requires OpenSSH (I think). You might be better off using libimobiledevice.