diff --git a/.travis.yml b/.travis.yml index 51dd2672dfaa13223d7182b23adcf667b92b8465..fa3e3640e01535fad39cc43aa53308deca81fbb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -125,7 +125,7 @@ script: after_success: - if [[ "${TRAVIS_OS_NAME}" = "android" && "${TRAVIS_PULL_REQUEST}" = "false" && "${TRAVIS_BRANCH}" = "master" ]]; then pip install --user google-api-python-client PyOpenSSL - && cd ${SHADOW_BUILD_DIR} && openssl aes-256-cbc -K $encrypted_25db6eb7c3fd_key -iv $encrypted_25db6eb7c3fd_iv -in ${TRAVIS_BUILD_DIR}/Google_Play_Android_Developer-bb93ae7d61ca.p12.enc -out Google_Play_Android_Developer-bb93ae7d61ca.p12 -d + && cd ${TRAVIS_BUILD_DIR} && openssl aes-256-cbc -K $encrypted_25db6eb7c3fd_key -iv $encrypted_25db6eb7c3fd_iv -in ${TRAVIS_BUILD_DIR}/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc -out android/Google_Play_Android_Developer-4432a3c4f5d1.json -d && ${TRAVIS_BUILD_DIR}/tools/google_play_upload.py org.mavlink.qgroundcontrol ${SHADOW_BUILD_DIR}/release/package/qgroundcontrol.apk ; fi diff --git a/Google_Play_Android_Developer-bb93ae7d61ca.p12.enc b/Google_Play_Android_Developer-bb93ae7d61ca.p12.enc deleted file mode 100644 index b821f735f95a0d563a0578725eb52b8ce2f99e29..0000000000000000000000000000000000000000 Binary files a/Google_Play_Android_Developer-bb93ae7d61ca.p12.enc and /dev/null differ diff --git a/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc b/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc new file mode 100644 index 0000000000000000000000000000000000000000..dae400d87ac5e44816df2b3ffecfdba57d09dd12 Binary files /dev/null and b/android/Google_Play_Android_Developer-4432a3c4f5d1.json.enc differ diff --git a/android/Google_Play_Android_Developer-bb93ae7d61ca.p12.enc b/android/Google_Play_Android_Developer-bb93ae7d61ca.p12.enc deleted file mode 100644 index 22c154d6fb4ad72b63667f87fba1aaf88b4e674a..0000000000000000000000000000000000000000 Binary files a/android/Google_Play_Android_Developer-bb93ae7d61ca.p12.enc and /dev/null differ diff --git a/tools/google_play_upload.py b/tools/google_play_upload.py index 094e40cfb25dfbff04b348dea41b8ddcf6fe94ec..4583b98ead6408480a8e06f6e006db7285d581b0 100755 --- a/tools/google_play_upload.py +++ b/tools/google_play_upload.py @@ -24,8 +24,7 @@ from oauth2client import client from oauth2client.service_account import ServiceAccountCredentials TRACK = 'beta' # Can be 'alpha', beta', 'production' or 'rollout' -SERVICE_ACCOUNT_EMAIL = ( - '868554619222-u4gvu4asjemc8n22o595j0fr2dg4012j@developer.gserviceaccount.com') +JSON_KEY='android/Google_Play_Android_Developer-4432a3c4f5d1.json' # Declare command-line flags. argparser = argparse.ArgumentParser(add_help=False) @@ -38,17 +37,12 @@ argparser.add_argument('apk_file', def main(): - # Load the key in PKCS 12 format that you downloaded from the Google APIs - # Console when you created your Service account. - f = file('Google_Play_Android_Developer-bb93ae7d61ca.p12', 'rb') - key = f.read() - f.close() - # Create an httplib2.Http object to handle our HTTP requests and authorize it # with the Credentials. Note that the first parameter, service_account_name, # is the Email address created for the Service account. It must be the email # address associated with the key that was created. - credentials = ServiceAccountCredentials.from_p12_keyfile(SERVICE_ACCOUNT_EMAIL, key, scopes=['https://www.googleapis.com/auth/androidpublisher']) + credentials = ServiceAccountCredentials.from_json_keyfile_name(JSON_KEY, scopes=['https://www.googleapis.com/auth/androidpublisher']) + http = httplib2.Http() http = credentials.authorize(http)