• Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
Wednesday, October 7, 2026
No Result
View All Result
Subscribe Now
  • Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA

    Washington state man charged with helping Canadian mass shooter plan for attack

    Border Security, Public Safety, and American Sovereignty with Markwayne Mullin

    Students injured as NJ high school bleachers collapse in scary scene

    California man in incest case busted in Mexico; teen daughter rescued

    Cornell president calls gang rape allegations ‘deeply disturbing’ : NPR

    France’s violent student protests raise warning for America: ‘A cautionary tale’

    Birmingham’s WBHM Public Radio Station Forced to Use “Gulf of America”

    Eminem gets online backlash from fans over Kid Rock Christian album collab

    Trump leans into Iran war, admits it could cost Republicans the midterms

  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
The Insight Post
  • Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA

    Washington state man charged with helping Canadian mass shooter plan for attack

    Border Security, Public Safety, and American Sovereignty with Markwayne Mullin

    Students injured as NJ high school bleachers collapse in scary scene

    California man in incest case busted in Mexico; teen daughter rescued

    Cornell president calls gang rape allegations ‘deeply disturbing’ : NPR

    France’s violent student protests raise warning for America: ‘A cautionary tale’

    Birmingham’s WBHM Public Radio Station Forced to Use “Gulf of America”

    Eminem gets online backlash from fans over Kid Rock Christian album collab

    Trump leans into Iran war, admits it could cost Republicans the midterms

  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
No Result
View All Result
No Result
View All Result
Home Mobile

Dev team tips: Keep your Android project secure using Codemagic

by Theinsightpost
August 7, 2022
in Mobile
0 0
0
Dev team tips: Keep your Android project secure using Codemagic


Written by Souvik Biswas

Every Android project needs to be digitally signed with a certificate before the generated APK (Android Application Package) or AAB (Android App Bundle) can be uploaded to the Google Play Store or other app stores.

The code signing process for any Android app is pretty straightforward if you are working individually on the project. You can perform the code signing directly in Android Studio, which will generate the signed bundle/APK file using a Java KeyStore.

In a team environment, it gets a bit challenging to share the key with other members and make sure that it remains secure. If your project repository is private, you might want to keep the Keystore file in the repo itself. Even if the repository is private, it’s a security risk to just upload any key onto the world wide web. If you really want to store your keys/certificates in the version control system, then the best method is to use git-secret.

But there’s still an issue.

You might not want every member of your team who has access to the project repository to also have access to the Keystore file.

In this article, we will take a deep dive into how you can store your Keystore file securely and easily sign and release your app to the Google Play Store using Codemagic CI/CD.

How Codemagic helps keep your project secure

Using Codemagic, you can easily encrypt sensitive values and files and store them securely in the environment variables of the configuration file (codemagic.yaml). Encrypting any file on Codemagic automatically encodes it to base64 format so that you have to decode the file during the build before using it.

Codemagic gives you access to encrypt variables both with a personal account and with a Team account. Codemagic generates the encrypted variables on a per-app basis.

For security reasons, encrypted environment variables only work on the account on which they were created. When moving an app from your personal account to a team, or from one team to another, you should re-encrypt the variables.

Members of a team account can have three types of user roles:

  • Owner: Can select the repositories to be shared with the team, invite new team members, change their roles or remove existing members (including other team owners), and manage team integrations and billing.

  • Member: Has access to the Codemagic UI and can view team settings, configure app settings and trigger new builds. Members cannot modify any team settings, billing details or repository settings other than the app name.

  • User: Can trigger builds from a webhook but does not have access to the team in the Codemagic UI.

These roles in Codemagic Teams make it easier to keep any sensitive credentials secure and make the project more manageable.

Follow along to learn in detail how to build and release your Android projects securely.

Generate Keystore

If you haven’t generated the Keystore file yet, you can do so using the following command:

keytool -genkey -v -keystore keystore_name.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

Run the command above in the directory where you want to store this Keystore file. Make sure it is stored securely and is not checked into the version control system by mistake. This is a very important file, as it is required both for signing your app for the first time as well as for publishing any future updates to the app.

Modify Gradle

You have to make a few modifications to your app-level build.gradle file in order to set it up for code signing.

To use Codemagic for signing your builds, add the following signingConfigs:

signingConfigs {
    release {
        if (System.getenv()["CI"]) { // CI=true is exported by Codemagic
            storeFile file(System.getenv()["CM_KEYSTORE_PATH"])
            storePassword System.getenv()["CM_KEYSTORE_PASSWORD"]
            keyAlias System.getenv()["CM_KEY_ALIAS"]
            keyPassword System.getenv()["CM_KEY_PASSWORD"]
        } else {
            storeFile file("/path/to/local/release.keystore")
            storePassword "keystore_password"
            keyAlias "key_alias"
            keyPassword "key_password"
        }
    }
}

Inside buildTypes release, add the following:

buildTypes {
    release {
        //...
        signingConfig signingConfigs.release
    }
}

Encrypt credentials

Codemagic will need access to the Keystore file for signing your Android app. As it’s a sensitive file, you shouldn’t give direct access to it. A more secure method is to encrypt the file before storing it so that Codemagic can access it during the build.

To encrypt the Keystore file, go to your Codemagic project Settings, and you will notice an Encrypt variables button. Click on it.

Now, you can drag and drop the file here.

This will generate an encrypted version of the file. You will require this in the next step while defining your workflow inside the codemagic.yaml file.

Define the workflow

In the root project directory, create a file called codemagic.yaml. Inside it, we will define a workflow for generating a code-signed build of the Android app. Add the following to the file:

release-workflow:
  name: Native Android
  max_build_duration: 60
  environment:
    vars:
      CM_KEYSTORE_PATH: /tmp/keystore.keystore
      CM_KEYSTORE: # Add encrypted keystore file
      CM_KEYSTORE_PASSWORD: # Add encrypted keystore password
      CM_KEY_ALIAS: # Add alias name
      CM_KEY_PASSWORD: # Add encrypted alias password
  scripts: # Add the build configurations here
  artifacts:
    - app/build/**/outputs/**/*.apk
  publishing:
    email:
      recipients:
        - name@example.com

Add the encrypted values to their respective variables. Also, change the email under the publishing section.

For building the project, add the following to the scripts section:

scripts:
  - name: Build Android
    script: |
      echo $CM_KEYSTORE | base64 --decode > $CM_KEYSTORE_PATH
      ./gradlew assembleRelease       

This will decode the base64-encoded Keystore file and generate the code-signed build of the Android app.

Set up for releasing

Codemagic helps you to easily release your Android app to Google Play Store. To automatically publish your app to the Play Store, you will need to set up a service account in Google Play Console and add the JSON key file to your codemagic.yaml file. Learn how to set up a service account here.

After creating the service account, add the following to your codemagic.yaml file under the publishing section:

publishing:
  google_play:
    credentials: Encrypted(...) # JSON key file for Google Play service account
    track: alpha                # Name of the track: internal, alpha, beta, production, internal app sharing, or your custom track name

There are various customizations that you can apply to the release. Learn more about them here.

Building the project on Codemagic

Before starting a build on Codemagic, make sure that you have committed the codemagic.yaml file to the version control system. You can either manually start a build or set up build triggering.

Start your build manually on Codemagic in two steps:

  1. Go to your project settings, and click on Start your first build.

  2. Select a workflow, and click on Start new build.

This will start a new build for your Android project.

Congratulations! ? You have securely built your Android project and published the code-signed app to the Google Play Store.

Conclusion

This article should have given you some insight into how Codemagic helps you keep your sensitive credentials secure while collaborating on an Android project. The user roles of the Codemagic Team account make it even easier to manage your project and help to restrict access to sensitive keys/files to only the specified members.

References


Souvik Biswas is a passionate Mobile App Developer (Android and Flutter). He has worked on a number of mobile apps throughout his journey. He loves open-source contribution on GitHub. He is currently pursuing a B.Tech degree in Computer Science and Engineering from Indian Institute of Information Technology Kalyani. He also writes Flutter articles on Medium – Flutter Community.



Source link

ShareTweetSend
Previous Post

Moraa, Kibiwott gather Commonwealth golds for Kenya

Next Post

Oration 27. Against the Eunomians – europeantimes.news

Related News

Mobile

Android Developers Blog: Device Streaming and Android skills

October 6, 2026
Mobile

Samsung confirms broad SmartTag 3 Android support

October 5, 2026
Mobile

How Can Software Consulting Company Benefit Your Business?

October 4, 2026
Mobile

Injection Molding Cost Estimation: How AI Delivers ROI

October 4, 2026
Next Post
Oration 27. Against the Eunomians – europeantimes.news

Oration 27. Against the Eunomians – europeantimes.news

Discussion about this post

Subscribe To Our Newsletters

    Customer Support


    1251 Wilcrest Drive
    Houston, Texas
    77042 USA
    Call-832.795.1420
    e-mail – news@theinsightpost.com

    Subscribe To Our Newsletters

      Categories

      • Africa
      • Africa-East
      • African Sports
      • American Sports
      • Arts
      • Asia
      • Australia
      • Business
      • Business Asia
      • Business- Africa
      • Canada
      • Defense
      • Education
      • Egypt
      • Energy
      • Entertainment
      • Europe
      • European Soccer
      • Finance
      • Germany
      • Ghana
      • Health
      • Insight
      • International
      • Investing
      • Japan
      • Latest Headlines
      • Life & Living
      • Markets
      • Mobile
      • Movies
      • New Zealand
      • Nigeria
      • Politics
      • Scholarships
      • Science
      • South Africa
      • South America
      • Sports
      • Tech
      • Travel
      • UK
      • USA
      • Weather
      • World
      No Result
      View All Result

      Recent News

      Boxing legend Mike Tyson talks going to juvie and trading cigarettes for cookies as a young boy

      October 7, 2026

      Hogbetsotso 2026 to promote tourism, local businesses

      October 7, 2026

      Mikel Arteta’s new contract: The challenges facing Arsenal boss as he enters ‘step five’ of his project | Football News

      October 7, 2026

      Spotify expands audiobooks to over 180 markets

      October 7, 2026
      • Home
      • Advertise With Us
      • About Us
      • Corporate
      • Consumer Rewards
      • Forum
      • Privacy Policy
      • Social Trends

      Theinsightpost ©2026 | All Rights Reserved. Theinsightpost is an Elnegy LLC company, registered in Texas, USA

      Welcome Back!

      Login to your account below

      Forgotten Password?

      Retrieve your password

      Please enter your username or email address to reset your password.

      Log In

      Add New Playlist

      We are using cookies to give you the best experience on our website.

      You can find out more about which cookies we are using or switch them off in .

      No Result
      View All Result
      • Home
      • Insight
      • Blog
      • Business
      • Entertainment
      • Health
      • Politics
      • Shop
        • Gift Shop
        • Value Shop
        • Store
        • Bargain Shop
        • Discount
      • Sports
      • Tech
      • Travel
      • USA
      • Video
      • World
        • Asia
        • Africa
        • South America
        • North America
        • Europe
        • Oceania

      Theinsightpost ©2026 | All Rights Reserved. Theinsightpost is an Elnegy LLC company, registered in Texas, USA

      The Insight Post
      Powered by  GDPR Cookie Compliance
      Privacy Overview

      This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

      Strictly Necessary Cookies

      Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

      Cookie Policy

      More information about our Cookie Policy

      Clear examples do more than decorate an explanation: they show how an idea behaves under recognizable conditions. In education and software documentation alike, strong illustrations begin with a defined goal, then reveal the steps, assumptions, and result without unnecessary detail. A practical test example should state the input, expected output, and boundary condition, because these elements show whether a rule works beyond the simplest case. Including a contrasting case also helps readers distinguish a valid application from a tempting but incorrect one, while concise notes explain why the outcomes differ. When examples are updated with current data and checked against the underlying rule, they remain useful across classrooms, product guides, and professional training.