Class MobileImageMounterClient

java.lang.Object
org.robovm.libimobiledevice.MobileImageMounterClient
All Implemented Interfaces:
java.lang.AutoCloseable

public class MobileImageMounterClient
extends java.lang.Object
implements java.lang.AutoCloseable
Mounts developer/debug disk images on the device.
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected MobileImageMounterClientRef ref  
    static java.lang.String SERVICE_NAME  
  • Constructor Summary

    Constructors
    Constructor Description
    MobileImageMounterClient​(IDevice device, LockdowndServiceDescriptor service)
    Creates a new MobileImageMounterClient and makes a connection to the com.apple.mobile.mobile_image_mounter service on the device.
  • Method Summary

    Modifier and Type Method Description
    protected void checkDisposed()  
    void close()  
    void dispose()  
    protected MobileImageMounterClientRef getRef()  
    com.dd.plist.NSDictionary lookupImage​(java.lang.String imageType)
    Checks if an image of the specified type has already been mounted.
    static void main​(java.lang.String[] args)  
    com.dd.plist.NSDictionary mountImage​(java.lang.String imagePath, byte[] imageSignature, java.lang.String imageType)
    Mounts an image on the device.
    void uploadImage​(java.io.File localImageFile, java.lang.String imageType, byte[] signature)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • mountImage

      public com.dd.plist.NSDictionary mountImage​(java.lang.String imagePath, byte[] imageSignature, java.lang.String imageType) throws java.io.IOException
      Mounts an image on the device. After an image has been mounted it will remain mounted until the device is rebooted. Returns an NSDictionary with Status=Complete on success. On error the NSDictionary will contain Error=ImageMountFailed.
      Parameters:
      imagePath - the path of the image to be mounted. Should be an absolute path inside the AFC jail on the device.
      imageSignature - the image's signature data.
      imageType - type of the image. If null is passed Developer will be used.
      Returns:
      the result of the mount.
      Throws:
      java.io.IOException
    • lookupImage

      public com.dd.plist.NSDictionary lookupImage​(java.lang.String imageType) throws java.io.IOException
      Checks if an image of the specified type has already been mounted. This method returns a plist similar to this when an image has been mounted:
       <plist version="1.0">
         <dict>
           <key>ImageDigest</key>
           <data>rBSGlwMv4yovqGM7sOk44vrE6xI=</data>
           <key>ImagePresent</key>
           <true/>
           <key>Status</key>
           <string>Complete</string>
         </dict>
       </plist>
       
      The ImageDigest value is the SHA-1 digest if the image file.

      If no image has been mounted ImagePresent=false and there will be no ImageDigest in the response.

      NOTE! It seems like this only returns ImagePresent=true the first time it is called after an image has been mounted. On subsequent calls it returns ImagePresent=false even if the image is still mounted.

      Parameters:
      imageType - type of the image to look for. If null is passed Developer will be used.
      Returns:
      the result of the lookup.
      Throws:
      java.io.IOException
    • uploadImage

      public void uploadImage​(java.io.File localImageFile, java.lang.String imageType, byte[] signature) throws java.io.IOException
      Throws:
      java.io.IOException
    • getRef

      protected MobileImageMounterClientRef getRef()
    • checkDisposed

      protected final void checkDisposed()
    • dispose

      public void dispose()
    • close

      public void close() throws java.lang.Exception
      Specified by:
      close in interface java.lang.AutoCloseable
      Throws:
      java.lang.Exception
    • main

      public static void main​(java.lang.String[] args) throws java.lang.Exception
      Throws:
      java.lang.Exception