final String filename = bundle.getName();
if (filename.toLowerCase().endsWith(".ipa")) {
listener.getLogger().println("Extracting .app from .ipa file...");
bundle.unzip(tmpDir);
FilePath payloadDir = tmpDir.child("Payload");
List<FilePath> payload = payloadDir.listDirectories();
if (payload==null || payload.isEmpty())
throw new IOException("Malformed IPA file: "+bundle);
appDir = payload.get(0);
} else if (filename.toLowerCase().endsWith(".app")) {
appDir = tmpDir.child(filename);