Skip to content

Commit

Permalink
Merge pull request #6 from godrei/app-store_deploy_fix
Browse files Browse the repository at this point in the history
disable public download page if app-store distribution
  • Loading branch information
viktorbenei committed Nov 30, 2015
2 parents ab82564 + 86d71ab commit 4a87097
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions uploaders/ipa_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
# --- upload ipa
# -----------------------

def export_method(mobileprovision_content)
# if ProvisionedDevices: !nil & "get-task-allow": true -> development
# if ProvisionedDevices: !nil & "get-task-allow": false -> ad-hoc
# if ProvisionedDevices: nil & "ProvisionsAllDevices": "true" -> enterprise
# if ProvisionedDevices: nil & ProvisionsAllDevices: nil -> app-store
if mobileprovision_content['ProvisionedDevices'].nil?
return 'enterprise' if !mobileprovision_content['ProvisionsAllDevices'].nil? && (mobileprovision_content['ProvisionsAllDevices'] == true || mobileprovision_content['ProvisionsAllDevices'] == 'true')
return 'app-store'
else
unless mobileprovision_content['Entitlements'].nil?
entitlements = mobileprovision_content['Entitlements']
return 'development' if !entitlements['get-task-allow'].nil? && (entitlements['get-task-allow'] == true || entitlements['get-task-allow'] == 'true')
return 'ad-hoc'
end
end
return 'development'
end

def deploy_ipa_to_bitrise(ipa_path, build_url, api_token, notify_user_groups, notify_emails, is_enable_public_page)
puts
puts "# Deploying ipa file: #{ipa_path}"
Expand All @@ -27,6 +45,16 @@ def deploy_ipa_to_bitrise(ipa_path, build_url, api_token, notify_user_groups, no
parsed_ipa_infos[:mobileprovision] = ipa_analyzer.collect_provision_info
fail 'Failed to collect Provisioning Profile information' if parsed_ipa_infos[:mobileprovision].nil?

if export_method(parsed_ipa_infos[:mobileprovision]) == 'app-store'
if is_enable_public_page
puts
puts ' (!) is_enable_public_page is set, but public download isn\'t allowed for app-store distributions'
puts ' (!) setting is_enable_public_page to false ...'
puts
is_enable_public_page = false
end
end

puts ' => Collecting Info.plist information'
parsed_ipa_infos[:info_plist] = ipa_analyzer.collect_info_plist_info
fail 'Failed to collect Info.plist information' if parsed_ipa_infos[:info_plist].nil?
Expand Down

0 comments on commit 4a87097

Please sign in to comment.