Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send VendDocuments command on HouseArrestClient #193

Closed
kekiefer opened this issue Apr 13, 2015 · 9 comments
Closed

Cannot send VendDocuments command on HouseArrestClient #193

kekiefer opened this issue Apr 13, 2015 · 9 comments

Comments

@kekiefer
Copy link
Contributor

This problem manifested itself on ifuse originally (libimobiledevice/ifuse#24), but I have the same issue using HouseArrestClient myself on iOS 8.3

device = imobiledevice.iDevice(serial)
ha_lockdown = imobiledevice.LockdownClient(device, 'myapp').start_service(imobiledevice.HouseArrestClient)
ha_client = imobiledevice.HouseArrestClient(device, ha_lockdown)
ha_client.send_command('VendDocuments', 'com.mycompany.myapp')
result = ha_client.get_result()
print "Initialized imobiledevice HouseArrestClient: %s" % (result)

And what I get

Initialized imobiledevice HouseArrestClient: {'Error': u'InstallationLookupFailed'}

Using VendContainer works fine, so there's a workaround (for my use case at least). I'm not sure what this error means. Is it just that Apple aren't supporting VendDocuments anymore?

@kekiefer kekiefer changed the title Cannot create HouseArrestClient on VendDocuments Cannot send VendDocuments command on HouseArrestClient Apr 13, 2015
@mingio
Copy link

mingio commented Apr 14, 2015

Hi, kekiefer
I get the InstallationLookupFailed error too when I use VendDocuments. But I use VendContainer and get the same error. Are u sure the VendContainer can work on ios8.3?

@kekiefer
Copy link
Contributor Author

Yes, though this was with just one app on two iPads. One interesting note here is that @dabvid from the issue referenced above reported that VendDocuments worked for him and VendContainer did not. Maybe there is more to this.

@kekiefer
Copy link
Contributor Author

So a debug build is working OK, but it turns out my workaround failed with the iTunes version of the app. The real situation may be rather dire:
http://www.iclarified.com/48418/ios-83-blocks-file-manager-software-from-accessing-app-data
http://www.macrumors.com/2015/04/13/ios-8-3-ifunbox-itools-sandbox-app-access/

The good news is, if you control the app (quoted from above)

We just figured out a solution to bring the sandbox access back for those Apps that willing to. Now sandbox access will only be available for Apps having "UIFileSharingEnabled" key set to true in their info.plist [ iPhoneOSKeys.html ] and the access is restricted to /Documents directory only.

@dunhamsteve
Copy link

VendContainer does appear to work for apps that are installed via either AdHoc or XCode, but not for apps installed via the App Store. (Tested via ifuse --container.)

@kekiefer
Copy link
Contributor Author

Thank you @dunhamsteve -- this does appear to be the case and it makes a lot more sense now.

@pauldotknopf
Copy link

Does anybody how to access the file system with the "UIFileSharingEnabled" method? HouseArrest has no knowledge of where I intend to modify the file system, so since that method is now broken, what other method is there to access the "/Documents" folder?

@mexmer
Copy link

mexmer commented May 28, 2015

in 8.3 they changed behavior of HA filesystem. (Security concerns)
VendDocuments works only for applications that have FileSharingUI enabled
aditionaly you cannot list root folder of HA (it gives access denied error), but you can cd into /Documents folder, there you can work like before.

@dunhamsteve
VendContainer was effectively removed, it works for testing (xcode pushed application), it works on applications that were not installed official way, but for security reasons, VendContainer is disabled for any "purchased" application

@pauldotknopf
Copy link

Hey guys, I started making a stub 64bit iTunesMobileDevice.dll that forwards methods to the real iTunesMobileDevice.dll so that we can intercept and see how some closed source applications are still allowing us to write to the iOS 8.3 shared "Documents" folder.

https://github.com/theonlylawislove/iTunesMobileDevice-Hook

iFunBox is using "AMDeviceCreateHouseArrestService" instead of "AMDeviceStartHouseArrestService". Maybe the former gives more options, letting us to HouseArrest an app in "Documents" mode, instead of "Container" mode.

Has anyone had any experience with the AMDeviceCreateHouseArrestService method? How is iFunBox using it to access an iPad app's documents directory?

@mexmer
Copy link

mexmer commented May 29, 2015

@theonlylawislove as i stated above you can write to /Documents in HA on 8.3, but you can start HA VendDocument only on applications that have filesharing enabled.
also as i said, you can't list content of /

you CD into /Documents, and work there ... that is ... works fine.

gnomesysadmins pushed a commit to GNOME/gvfs that referenced this issue Mar 19, 2016
Only sideloaded applications (development versions for example) can use
the VendContainer method of accessing application documents.

Always use the VendDocuments method instead.

Note that we'll also re-root the Documents folder as the root of the app
container is inaccessible ("EPERM") to avoid users fiddling with it.

See libimobiledevice/libimobiledevice#193 (comment)

https://bugzilla.gnome.org/show_bug.cgi?id=763606
gnomesysadmins pushed a commit to GNOME/gvfs that referenced this issue Mar 19, 2016
As we can only start HouseArrest for applications that have
UIFileSharingEnabled turned on, there's absolutely no need to list the
other applications.

See libimobiledevice/libimobiledevice#193

https://bugzilla.gnome.org/show_bug.cgi?id=763606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants