diff --git a/CHANGELOG.md b/CHANGELOG.md index b56c9b17..721de862 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,11 @@ The changes documented here do not include those from the original repository. ## [Unreleased] +## 2024-03-22 +- Fixed hook for ODC (https://outsystemsrd.atlassian.net/browse/RMET-3191). + ## 2024-03-18 -- Implemented the usage of the Activity Transition Recognition API for background jobs (https://outsystemsrd.atlassian.net/browse/RMET-3191). +- Implemented the usage of the Activity Transition Recognition API for background jobs (https://outsystemsrd.atlassian.net/browse/RMET-3246). ## 2024-03-14 - Implemented the usage of exact alarms for background jobs (https://outsystemsrd.atlassian.net/browse/RMET-3190). diff --git a/hooks/androidCopyPrivacyUrlEnv.js b/hooks/androidCopyPrivacyUrlEnv.js index caa22068..ec290c29 100644 --- a/hooks/androidCopyPrivacyUrlEnv.js +++ b/hooks/androidCopyPrivacyUrlEnv.js @@ -11,7 +11,7 @@ module.exports = async function (context) { const projectRoot = context.opts.cordova.project ? context.opts.cordova.project.root : context.opts.projectRoot; const platformPath = path.join(projectRoot, `platforms/android/app/src/main/assets/www/${fileNamePrivacyPolicy}`); - if (fileExists(platformPath)) { + if (fileExists(platformPath) || policyFileExists()) { const configXML = path.join(projectRoot, 'config.xml'); const configParser = new ConfigParser(configXML); @@ -43,3 +43,18 @@ function setPrivacyPolicyUrl(configParser, projectRoot) { throw new Error("Error getting the environment variables."); } } + +function policyFileExists() { + const directoryPath = 'platforms/android/app/src/main/assets/www'; + const searchString = 'HealthConnect_PrivacyPolicy'; + try { + const files = fs.readdirSync(directoryPath); + const matchingFiles = files.filter(fileName => fileName.includes(searchString)); + + // return true if there are matching files, false otherwise + return matchingFiles.length > 0; + } catch (error) { + console.error('An error occurred:', error); + return false; + } +} diff --git a/src/android/build.gradle b/src/android/build.gradle index a1f6596c..2cf88bfe 100644 --- a/src/android/build.gradle +++ b/src/android/build.gradle @@ -26,7 +26,7 @@ dependencies{ implementation("com.github.outsystems:oscore-android:1.2.0@aar") implementation("com.github.outsystems:oscordova-android:2.0.1@aar") - implementation("com.github.outsystems:oshealthfitness-android:1.2.0.26@aar") + implementation("com.github.outsystems:oshealthfitness-android:1.2.0.27@aar") implementation("com.github.outsystems:osnotificationpermissions-android:0.0.4@aar") // activity