Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RMET- 3142 H&F Plugin - Hook for permissions #106

Merged
merged 46 commits into from
Feb 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
48d119c
feat: first implementation of androidCopyPreferencesPermissions hook
alexgerardojacinto Feb 26, 2024
ce8c7fb
fix: fix path to hook file
alexgerardojacinto Feb 26, 2024
6d5adb7
fix: add dependency to xmldom
alexgerardojacinto Feb 26, 2024
25f59c5
feat: implement first version of hook processing preferences
alexgerardojacinto Feb 26, 2024
42f8e26
refactor: remove unnecessary code
alexgerardojacinto Feb 26, 2024
66a0579
fix: fix comparator in condition
alexgerardojacinto Feb 27, 2024
3a8c9a4
test: add log for troubleshooting
alexgerardojacinto Feb 27, 2024
2a82512
test: add log for troubleshooting
alexgerardojacinto Feb 27, 2024
0f5f490
test: add log for troubleshooting
alexgerardojacinto Feb 27, 2024
66233bb
fix: use "" instead of null in comparison
alexgerardojacinto Feb 27, 2024
ce06243
refactor: remove logs
alexgerardojacinto Feb 27, 2024
1b24274
refactor: remove logs and comments
alexgerardojacinto Feb 27, 2024
93bb61f
feat: add permissions code for Android <= 13
alexgerardojacinto Feb 27, 2024
06aea9e
fix: fix variable name
alexgerardojacinto Feb 27, 2024
4d5fe19
feat: add background permissions to AndroidManifest.xml file
alexgerardojacinto Feb 27, 2024
67f789a
fix: properly pass DOMParser to functions
alexgerardojacinto Feb 27, 2024
6c76b26
fix: fix condition in if for background job permissions
alexgerardojacinto Feb 27, 2024
3639f4c
feat: remove unnecessary permissions
alexgerardojacinto Feb 27, 2024
b73c364
test: add logs for troubleshooting
alexgerardojacinto Feb 27, 2024
81005c4
fix: fix if condition
alexgerardojacinto Feb 27, 2024
6c6eaa5
feat: copy notification content to strings.xml
alexgerardojacinto Feb 27, 2024
27bdfc4
fix: fix query selector
alexgerardojacinto Feb 27, 2024
326b296
fix: properly look for string tags
alexgerardojacinto Feb 27, 2024
2b627fc
test: add logs for troubleshooting
alexgerardojacinto Feb 27, 2024
57ef033
misc: add log for troubleshooting
alexgerardojacinto Feb 27, 2024
1cd29ce
misc: add logs for troubleshooting
alexgerardojacinto Feb 27, 2024
d6c9209
feat: use different way of setting texts in strings.xml
alexgerardojacinto Feb 27, 2024
2cfb12b
refactor: remove logs and comments
alexgerardojacinto Feb 27, 2024
b2645e0
fix: replace const with var
alexgerardojacinto Feb 27, 2024
dd48586
feat: add PermissionsRationaleActivity to AndroidManifest.xml
alexgerardojacinto Feb 27, 2024
71d6e9b
feat: also use default value for notificationDescription
alexgerardojacinto Feb 27, 2024
a5e5350
fix: add missing permissions for background jobs
alexgerardojacinto Feb 27, 2024
e854541
Merge branch 'development' into feat/RMET-3142/hook-permissions
alexgerardojacinto Feb 27, 2024
1f35540
chore: update changelog
alexgerardojacinto Feb 27, 2024
806814e
refactor: use correct english term
alexgerardojacinto Feb 27, 2024
ec7554d
fix: include necessary dependencies
alexgerardojacinto Feb 27, 2024
82b3cdb
fix: include dependencies for Jetpack Compose in build.gradle
alexgerardojacinto Feb 27, 2024
cdb5c6c
refactor: fix typo
alexgerardojacinto Feb 28, 2024
a583d54
feat: add helper method to avoid code replication
alexgerardojacinto Feb 28, 2024
7c928dc
fix: pass XML Documents to helper function
alexgerardojacinto Feb 28, 2024
aa02e3f
fix: pass necessary parameter to helper function
alexgerardojacinto Feb 28, 2024
251451e
refactor: use helper methods to avoid code repetition
alexgerardojacinto Feb 28, 2024
ea92c44
refactor: use helper functions and maps to avoid code repetition and …
alexgerardojacinto Feb 28, 2024
eedc73c
feat: populate objects with correct values
alexgerardojacinto Feb 29, 2024
90ea19a
refactor: remove unused requires
alexgerardojacinto Feb 29, 2024
f75b62b
Merge branch 'development' into feat/RMET-3142/hook-permissions
alexgerardojacinto Feb 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: add logs for troubleshooting
alexgerardojacinto committed Feb 27, 2024

Verified

This commit was signed with the committer’s verified signature.
alexgerardojacinto Alexandre Jacinto
commit b73c36458f8de84231d4b40f946e58d9d588c778
19 changes: 17 additions & 2 deletions hooks/androidCopyPreferencesPermissions.js
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ module.exports = async function (context) {

// add background job permissions to AndroidManfiest.xml
OS-ricardomoreirasilva marked this conversation as resolved.
Show resolved Hide resolved
addBackgroundJobPermissionsToManifest(configParser, projectRoot, parser);

};

function addHealthConnectPermissionsToXmlFiles(configParser, projectRoot, parser) {
@@ -1123,9 +1124,23 @@ function addHealthConnectPermissionsToXmlFiles(configParser, projectRoot, parser
function addBackgroundJobPermissionsToManifest(configParser, projectRoot, parser) {

const disableBackgroundJobs = configParser.getPlatformPreference('DisableBackgroundJobs', 'android');


console.log('disableBackgroundJobs: ' + disableBackgroundJobs);

if (disableBackgroundJobs === false) {
console.log('first');
}

if (disableBackgroundJobs == "false") {
console.log('second');
}

if (disableBackgroundJobs === "false") {
console.log('third');
}

// we want to include the permissions by default
if (disableBackgroundJobs == false || disableBackgroundJobs == "") {
if (disableBackgroundJobs === false || disableBackgroundJobs == "") {

const manifestFilePath = path.join(projectRoot, 'platforms/android/app/src/main/AndroidManifest.xml');
const manifestXmlString = fs.readFileSync(manifestFilePath, 'utf-8');