2 Google Play Integrity
This topic describes the systematic instruction to Google Play Integrity option.
- Go to URL https://console.developers.google.com/
- Create a new Project and set name of you project.
- ChooseAPI’s & Services option from side bar.
- In API’s & Services → Dashboard → Choose Enable APIS AND
SERVICES.
- This will redirect to Library where we need to search
Google Play Integrity API..
- Click on Google Play Integrity API and enable it.
- If the application usage is high, the quota request form needs to
be submitted. Fill quota request form from below site. Also select below
options.
https://support.google.com/googleplay/android-developer/contact/piaqr
- Quota request - Estimated total queries per day * → The approximate load, Play
Integrity API is called once each time the app in opened
Quota request - Estimated peak queries per second → Leave blank
- To enable Play Integrity responses follow below steps:
Go to Google Play Console → Side Menu → App Integrity

Description of the illustration mnandrd15-7.pngClick on Settings.

Description of the illustration mnandrd15-8.pngClick on Link project and then link your existing google cloud project. If it is not created then create new and link the same.

Description of the illustration mnandrd15-9.png - Scroll down on the same screen and click on Change Responses.
- Enable the Meet basic Integrity & Meets Strong Integrity option
and save the changes.
- Scroll down on the same screen and click on Edit button of classic
requests section.
- In the window that appears, select Manage and download my response encryption
keys and follow below steps to generate response encryption keys-
- Create a new private-public key pair. RSA key size must be
2048 bits using below
command-
openssl genrsa -aes128 -out your_path/private.pem 2048Then use your password phrase for creating private.pem and also use the same password for verifying the private.pem. Then hit the below command.
openssl rsa -in your_path/private.pem -pubout -out your_path/public.pemEnter the same password which you have used while creating private.pem. These two files will now appear on your mentioned path. Then upload the public.pem file on the window which was appeared after clicking on Manage and download my response encryption keys option.Once you upload the public.pem file it will automatically download your_app_pkg_name.enc file. Then hit below command as,
openssl pkeyutl -decrypt -inkey your_path/private.pem -pkeyopt rsa_padding_mode:oaep -in your_path/com.demo.xz.enc > your_path/api_keys.txt.Enter the password for private.pem. It will create api_keys.txt file on your path. It must be consist of
VERIFICATION_KEY and DECRYPTION_KEY. - Maintain this
VERIFICATION_KEYandDECRYPTION_KEYinDIGX_FW_CONFIG_ALL_Btable corresponding to the following keys respectively:PLAY_INTEGRITY_ENCRYPTION_KEY and PLAY_INTEGRITY_DECRYPTION_KEYAn example query will be:
update DIGX_FW_CONFIG_ALL_B set prop_value = 'YOUR_DECRYPTION_KEY' where prop_id = 'PLAY_INTEGRITY_DECRYPTION_KEY'; update DIGX_FW_CONFIG_ALL_B set prop_value = 'YOUR_ENCRYPTION_KEY' where prop_id = 'PLAY_INTEGRITY_ENCRYPTION_KEY'; - Similarly, Obtain the same keys for authenticator app by using above
steps and then maintain those in
DIGX_FW_CONFIG_ALL_Btable corresponding to the following keys respectively:PLAY_INTEGRITY_ENCRYPTION_KEY_AUTHENTICATORand
PLAY_INTEGRITY_DECRYPTION_KEY_AUTHENTICATORAn example query will be:
update DIGX_FW_CONFIG_ALL_B set prop_value = 'YOUR_DECRYPTION_KEY' where prop_id = 'PLAY_INTEGRITY_DECRYPTION_KEY_AUTHENTICATOR'; update DIGX_FW_CONFIG_ALL_B set prop_value = 'YOUR_ENCRYPTION_KEY' where prop_id = 'PLAY_INTEGRITY_ENCRYPTION_KEY_AUTHENTICATOR';
- Create a new private-public key pair. RSA key size must be
2048 bits using below
command-
- Add project number in below property of app.properties
<string name="GOOGLE_CLOUD_PROJECT_NO">@@GOOGLE_CLOUD_PROJECT NO</string>
You will get the project number on google cloud console project
- Mention the time in seconds to which app can hit the play integrity
api. By default it is 300seconds but you can configure as per the requirement.
Use below property in RootCheckFlags.java(workspace_installer/zigbank/platforms/android/app/src/main/java/com/ofss/digx/mobile/android/) long playIntegrityAPICallTime = your_time_in_seconds;
long playIntegrityAPICallTime = your_time_in_seconds;
- Scroll down on the App Integritypage.
Navigate to Store listing visibility.
Click on Settings button.
Select Strong Integrity checks option and Save.
Note:
By enabling this setting your app will not be listed on play store of rooted device















