[PATCH] new installation_proxy interface
-
Nikias Bassen
Last minute update!
Here's a follow-up patch that adds an 'options' parameter to instproxy_archive. Currently, you can specify the following options:
INSTPROXY_ARCHIVE_APP_ONLY - Archive only the application data INSTPROXY_ARCHIVE_SKIP_UNINSTALL - Do not uninstall the application.Combine these options with logical OR to specify both. These two options
combined are used by iTunes to create app archives of on-device downloaded
apps that are later copied as *.ipa files to the computer.If no option is specified (options set to 0), ALL app data including app specific user settings and data will be archived AND the application will be uninstalled afterwards.
Note that if INSTPROXY_ARCHIVE_SKIP_UNINSTALL is specified the device will NOT fire the com.apple.mobile.application_uninstalled (NP_APP_UNINSTALLED) notification.
And note that to remove an application archive, the correct way is to use instproxy_remove_archive; as far as I know it is NOT enough to just remove the ZIP file from the ApplicationArchives folder, it is also stored somewhere else.
-
Matt Colyer
- State changed from open to resolved
(from [daee8be013dae3821463fd85f4076ca2ab3adce6]) Add options to instproxy_archive function
This change allows to specify the following options:
- Archive only the application data - Do not uninstall the application.Combine these options with logical OR to specify both. These two options
combined are used by iTunes to create app archives of on-device downloaded
apps that are later copied as *.ipa files to the computer.[#104 [PATCH] new installation_proxy interface state:resolved]
Signed-off-by: Matt Colyer matt@colyer.name
http://github.com/MattColyer/libiphone/commit/daee8be013dae3821463f... -
Paul Sladen
Hmm. Seems my email from earlier this week didn't get through:
Subject: Re: [libiphone #104 [PATCH] new installation_proxy interface] options FLAG names
INSTPROXY_ARCHIVE_APP_ONLY - Archive only the application data INSTPROXY_ARCHIVE_SKIP_UNINSTALL - Do not uninstall the application.
I've read this a few times and I'm still having difficulty following what
happens in each case---which is perhaps an indication that the flags need
renaming (or possibly inverting?).SKIP_UNINSTALL sounds like a double-negative, should it be just INSTALL
Should APP_ONLY be perhaps DATA_ONLY; the interface is one for installing
application packages, so repeating 'app' doesn't help.If the "Note that..." explanation is needed, something is non-obvious and
perhaps it's possible to make it obvious instead.There may also be more to this than meets the eye; is
uninstall(options=_INSTALL) perhaps a --reinstall?ApplicationArchives folder, it is also stored somewhere else.
I would have thought that we add/insert it into the public AFC chroot, and
then fire the API install/remove which unpackages it to the hidden
/root; but that's only a hunch as I don't have the necessary to test that hypothesis. -
Matt Colyer
- State changed from resolved to open
Nope I don't have a copy of your email.
Can you work up a proposed patch to change the names?
-
Nikias Bassen
OK, the names might be a bit confusing, but remember those are for the function instproxy_archive which is not for installing an app but to make an archive of an installed app. And the names were taken from the plist protocol of the installation_proxy interface:
This flag has it's name from the key 'SkipUninstall' which is set to 'true' before sending the 'Archive' command to the device, meaning not to uninstall the app for which an archive should be made. Without this flag the app will be archived AND uninstalled.INSTPROXY_ARCHIVE_SKIP_UNINSTALLINSTPROXY_ARCHIVE_APP_ONLYThis flag has it's name from the key 'ArchiveType' which is set to the value 'ApplicationOnly' before sending the command to the device, meaning to just archive the app data itself without any user settings or files created by the app. This is basically what gives us an install package like iTunes stores them on the local compute (either from the device or out of the app store).
I think the naming is OK as it just reflects the protocol.
-
Paul Sladen
Yup, still confusing. Perhaps the second (based on the key:value used in the protocol should be the (unabbreviated):
INSTPROXY_ARCHIVE_TYPE_APPLICATION_ONLY
which is a more honest following of the enum (reads better and looks less tacky). Are there any other enums for the "ArchiveType" parameter?
-
Martin S.
- Assigned user changed from Matt Colyer to Paul Sladen
That way it actually should be INSTPROXY_ARCHIVE_CLIENT_OPTIONS_ARCHIVE_TYPE_APPLICATION_ONLY. Perhaps a bit weired.
I think Nikias defines that INSTPROXY_ARCHIVE_* are flags for the "Archive" installation_proxy command's "ClientOptions".
Each command appears to have it's own set of "ClientOptions. For instance install/upgrade has like "iTunesMetadata" so the additional "INSTPROXY*" grouping seems rational, or? Suggestions?
-
Nikias Bassen
- Assigned user changed from Paul Sladen to Matt Colyer
Hi guys,
I reworked the code to use plist client options for each function so we don't have to alter the service implementation when new client options show up. There are several function that don't have and probably will never have any client options, but to be prepared I added client options to every operation.
I added some helper functions to allow easy handling of client options, e.g. for using the options ArchiveType:ApplicationOnly and SkipUninstall:TRUE when calling instproxy_archive you can simply do:plist_t opts = instproxy_client_options_new(); // you can use just one call instproxy_client_options_add(opts, "ArchiveType", "ApplicationOnly", "SkipUninstall", 1, NULL); // OR you can separate them instproxy_client_options_add(opts, "ArchiveType", "ApplicationOnly", NULL); instproxy_client_options_add(opts, "SkipUninstall", 1, NULL); // do the operation instproxy_archive(client, "com.yourcompany.yourapp", opts, status_cb); instproxy_client_options_free(opts);If you want to perform operations without client options or operations that do not require any client options, pass NULL:
instproxy_browse(client, NULL, &apps);So with the attached patch the above discussed naming issue has been solved ;)
-
Matt Colyer
- State changed from open to resolved
(from [1999ce8929dcad052e4af48f23daab2264b312e7]) installation_proxy: rework code to use plist client_options
[#104 [PATCH] new installation_proxy interface state:resolved] http://github.com/MattColyer/libiphone/commit/1999ce8929dcad052e4af...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
