This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const projectId = <YourProjectID>; | |
| const locationId = <YourPreferedStorageLocationID>; //Based on the google cloud regions e.g. us-central1 | |
| const keyRingId = <KeyRingID>; | |
| const keyId = <YourKeyId>; | |
| const kmsClient = new KeyManagementServiceClient(); | |
| const locationName = kmsClient.locationPath(projectId, locationId); | |
| async function encryptAndStoreToken(token: any) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { KeyManagementServiceClient } = require('@google-cloud/kms'); | |
| const projectId = <YourProjectID>; | |
| const locationId = <YourPreferedStorageLocationID>; //Based on the google cloud regions e.g. us-central1 | |
| const keyRingId = <KeyRingID>; | |
| const keyId = <YourKeyId>; | |
| const kmsClient = new KeyManagementServiceClient(); | |
| const locationName = kmsClient.locationPath(projectId, locationId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const projectId = <YourProjectID>; | |
| const locationId = <YourPreferedStorageLocationID>; //Based on the google cloud regions e.g. us-central1 | |
| const keyRingId = <KeyRingID>; | |
| const kmsClient = new KeyManagementServiceClient(); | |
| const locationName = kmsClient.locationPath(projectId, locationId); | |
| async function createKeySymmetricEncryptDecrypt() { | |
| const keyRingName = await kmsClient.keyRingPath(projectId, locationId, keyRingId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { KeyManagementServiceClient } = require('@google-cloud/kms'); | |
| const projectId = <YourProjectID>; | |
| const locationId = <YourPreferedStorageLocationID>; //Based on the google cloud regions e.g. us-central1 | |
| const keyRingId = <KeyRingID>; | |
| const kmsClient = new KeyManagementServiceClient(); | |
| const locationName = kmsClient.locationPath(projectId, locationId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UrlFetchApp.fetch("https://www.googleapis.com/androidpublisher/v3/applications/your_package_name/reviews?access_token=your_auth_token"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var response = UrlFetchApp.fetch("https://www.googleapis.com/androidpublisher/v3/applications/your_package_name/reviews?access_token=your_auth_token"); | |
| // Parse the JSON reply | |
| var json = response.getContentText(); | |
| var data = JSON.parse(json); | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var sheet = ss.getActiveSheet(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getColByName(name){ | |
| var headers = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1').getDataRange().getValues()[1]; | |
| var colindex = headers.indexOf(name); | |
| return colindex+1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getLatestReviews() { | |
| var token = Goth.getToken('PlayConsole') | |
| var response = UrlFetchApp.fetch("https://www.googleapis.com/androidpublisher/v3/applications/your_package_name/reviews?access_token=your_auth_token"); | |
| // Parse the JSON reply | |
| var json = response.getContentText(); | |
| var data = JSON.parse(json); | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var sheet = ss.getActiveSheet(); | |
| var reviews = data["reviews"].reverse() | |
| var lastRow = sheet.getLastRow(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * namespace to deal with oauth | |
| * @namespace Oauth | |
| */ | |
| var Goth = (function(ns) { | |
| /** | |
| * get a goa or fail | |
| * @param {string} packageName the package name | |
| * @param {PropertiesService} [props=ScriptProperties] |