Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def self.run(params)
UI.message("Current edit not found, creating a new edit")
Helper::AmazonAppSubmissionHelper.create_new_edit(token, params[:app_id])
current_edit_id, edit_eTag = Helper::AmazonAppSubmissionHelper.open_edit(token, params[:app_id])
end
end

if current_edit_id.nil?
UI.error("Creating new edit failed!")
Expand All @@ -35,7 +35,7 @@ def self.run(params)
current_apk_eTag = Helper::AmazonAppSubmissionHelper.get_current_apk_etag(token, params[:app_id], current_edit_id, current_apk_id)

UI.message("Replacing the apk with apk from #{params[:apk_path]}")
replace_apk_response_code, replace_apk_response = Helper::AmazonAppSubmissionHelper.replaceExistingApk(token, params[:app_id], current_edit_id, current_apk_id, current_apk_eTag, params[:apk_path])
replace_apk_response_code, replace_apk_response = Helper::AmazonAppSubmissionHelper.replace_existing_apk(token, params[:app_id], current_edit_id, current_apk_id, current_apk_eTag, params[:apk_path])
end

if params[:upload_changelogs]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def self.create_new_edit(token, app_id)

res = http.request(req)
current_edit = JSON.parse(res.body)

return current_edit['id']
end

Expand Down Expand Up @@ -112,7 +112,7 @@ def self.get_current_apk_etag(token, app_id, edit_id, apk_id)
return res.header['ETag']
end

def self.replaceExistingApk(token, app_id, edit_id, apk_id, eTag, apk_path, should_retry = true)
def self.replace_existing_apk(token, app_id, edit_id, apk_id, eTag, apk_path, should_retry = true)

replace_apk_path = "/v1/applications/#{app_id}/edits/#{edit_id}/apks/#{apk_id}/replace"
local_apk = File.open(apk_path, "r").read
Expand All @@ -139,7 +139,7 @@ def self.replaceExistingApk(token, app_id, edit_id, apk_id, eTag, apk_path, shou
# Retry again if replace failed
if res.code == '412' && should_retry
UI.message("replacing the apk failed, retrying uploading it again...")
replaceExistingApk(token, app_id, edit_id, apk_id, eTag, apk_path, false)
replace_existing_apk(token, app_id, edit_id, apk_id, eTag, apk_path, false)
return
end
return res.code, replace_apk_response
Expand All @@ -164,7 +164,7 @@ def self.delete_apk(token, app_id, edit_id, apk_id, eTag)
result_json = JSON.parse(res.body)
end

def self.uploadNewApk(token, app_id, edit_id, apk_path)
def self.upload_new_apk(token, app_id, edit_id, apk_path)

add_apk_path = "/v1/applications/#{app_id}/edits/#{edit_id}/apks/upload"
add_apk_url = BASE_URL + add_apk_path
Expand Down