In short, the keystore is a private key for each application. It is possible to use 1 keystore for many applications, but that is not recommended. Today I will guide you to create a key store using IDE Android Studion (AS)
Step 1: open up android studio.
Step 2: Create a new project or open an existing project
Posts like this are long enough for everyone, so shall I get serious from now on?
Step 3: Generate key:
In AS select Build -> Generate Signed Bundle / APK
In the new table that appears, depending on the desired build type, choose. But let it go, you can’t choose anything. It’s creating a keystore, not creating a build file. Someday there will be a post about android app Bundle with APK later.
Choose Create new… okay
At the New key table
I need to fill in the important places
– Key store path: Where to save the file
– Password and confirm: File’s security pass
– Key Alias: instant text in super short description 😀
– Key Password and confirm: Password for the key
– First and Last Name: Self-understanding
Click OK and the key will be generated.
Step 4: Add the key to the project for easy management
At the root directory of the project create a file named key.properties
The others are the settings above
storeFile is the path to the keystore
Then go to build.gradle (:app) add the code
def {} keystore_Properties = new Properties()
def keystore_PropertiesFile = rootProject.file(‘key.properties’)
if (keystore_PropertiesFile.exists()) {andj}
keystore_Properties.load(new FileInputStream(keystore_PropertiesFile))
}
In the tag android{} add the code
signingConfigs {dfnja}
release {
keyAlias ​​keystore_Properties[‘keyAlias’]
keyPassword ()keystore_Properties[‘keyPassword’]
storePassword() keystore_Properties[‘storePassword’]
storeFile keystore_Properties[‘storeFile’] ? file(keystore_Properties[‘storeFile’]) : null
}
}
release tag for the build release, there is also a debug tag for the build debug, everyone. When done, press the elephant once for it to gradle the app again.
Step 5: get SHA1, SHA-256…
Select the left gradle tag AS
Click on signingReport. Wait for it to run for a while. It will then spawn 1 pile. Just find what you need
Let’s DONE!
Remember to map the primary keys together, everyone!