문제

I've got a packaged .ipa package as a basis for this task. This I'd like to select and then run the Automator service to do the work for me.

These are the steps the service needs to to:

  1. Rename the input's .ipa to .zip
  2. Extract the zip archive
  3. The extracted archive contains a single directory (Payload) with a single .app file in it. The service somehow needs to open this .app file. In Finder you simply say "Show Package contents".
  4. Inside the .app package I need to paste a file. Ideally this should have been asked by the Service in the very beginning.
  5. Use codesign to sign the .app package again. Codesign needs a parameter (the certificate to use) as well. This should be asked by the service as well (it's just a String value that needs to be identical to a key in the keystore).
  6. Zip the Payload again
  7. Delete the original file.
  8. Rename the Payload.zip to the original file's name.ipa

Pretty big task and I'm not sure if that can be accomplished with Automator. Since I've never worked with it, I'm pretty much stuck already at point 3.

I can do all these steps manually, but I'd really have this automated.

As I said, steps 1 and 2 are done using "Rename Finder Items" and "Open Finder Items". Input value is the selected file in Finder. If necessary, this can be split into two parts or so if one service isn't going to be able to do this.

Any help would be highly appreciated!

도움이 되었습니까?

해결책

You might just use a shell script like this:

for f; do
  temp=/tmp/$(uuidgen)
  mkdir $temp
  cd $temp
  unzip "$f"
  cp /path/to/file Payload/*.app
  codesign -s /path/to/certificate Payload/*.app
  rm "$f"
  zip -r "$f" Payload
  rm -r $temp
done
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top