From 57fc0bd5d3267ab783402ba001a16c69c9f80f84 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Wed, 17 Aug 2022 16:13:23 +0200 Subject: [PATCH 1/4] 2-Change artifactId for api module, to help cohabitation with permissions module. --- app/build.gradle | 17 +++++++++-------- fakelocation/fakelocationdemo/build.gradle | 2 +- permissionsstandalone/build.gradle | 2 +- {api => privacymodule-api}/.gitignore | 0 {api => privacymodule-api}/build.gradle | 6 ++++-- {api => privacymodule-api}/consumer-rules.pro | 0 {api => privacymodule-api}/proguard-rules.pro | 0 .../src/main/AndroidManifest.xml | 0 .../e/privacymodules/DependencyInjector.kt | 0 .../location/IFakeLocationModule.kt | 0 .../permissions/APermissionsPrivacyModule.kt | 0 .../permissions/IPermissionsPrivacyModule.kt | 0 .../permissions/data/AppOpModes.kt | 0 .../permissions/data/ApplicationDescription.kt | 0 .../permissions/data/PermissionDescription.kt | 0 .../trackers/IBlockTrackersPrivacyModule.kt | 0 .../e/privacymodules/trackers/IDNSBlocker.kt | 0 .../trackers/ITrackTrackersPrivacyModule.kt | 0 .../e/privacymodules/trackers/Tracker.kt | 0 settings.gradle | 2 +- trackers/build.gradle | 5 +++-- 21 files changed, 19 insertions(+), 15 deletions(-) rename {api => privacymodule-api}/.gitignore (100%) rename {api => privacymodule-api}/build.gradle (97%) rename {api => privacymodule-api}/consumer-rules.pro (100%) rename {api => privacymodule-api}/proguard-rules.pro (100%) rename {api => privacymodule-api}/src/main/AndroidManifest.xml (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/DependencyInjector.kt (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/location/IFakeLocationModule.kt (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/permissions/data/AppOpModes.kt (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/permissions/data/ApplicationDescription.kt (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/permissions/data/PermissionDescription.kt (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt (100%) rename {api => privacymodule-api}/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt (100%) diff --git a/app/build.gradle b/app/build.gradle index 61ee623f..71d0f804 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -111,16 +111,17 @@ android { } dependencies { - implementation project(':api') - + implementation project(':privacymodule-api') standaloneImplementation project(':permissionsstandalone') - e29Implementation('foundation.e:privacymodule.e-29:1.2.0') { - exclude group: 'foundation.e', module: 'privacymodule.api' - } - e30Implementation('foundation.e:privacymodule.e-30:1.2.0') { - exclude group: 'foundation.e', module: 'privacymodule.api' - } + e29Implementation('foundation.e:privacymodule-e-29:1.2.0') +// { +// exclude group: 'foundation.e', module: 'privacymodule-api' +// } + e30Implementation('foundation.e:privacymodule-e-30:1.2.0') +// { +// exclude group: 'foundation.e', module: 'privacymodule-api' +// } implementation project(':fakelocation') diff --git a/fakelocation/fakelocationdemo/build.gradle b/fakelocation/fakelocationdemo/build.gradle index 12ed2e79..c182b2f8 100644 --- a/fakelocation/fakelocationdemo/build.gradle +++ b/fakelocation/fakelocationdemo/build.gradle @@ -54,7 +54,7 @@ android { } dependencies { - implementation project(':api') + implementation project(':privacymodule-api') implementation project(':fakelocation') implementation project(':permissionsstandalone') diff --git a/permissionsstandalone/build.gradle b/permissionsstandalone/build.gradle index aadb84f8..ef03f2bf 100644 --- a/permissionsstandalone/build.gradle +++ b/permissionsstandalone/build.gradle @@ -51,8 +51,8 @@ dependencies { Libs.AndroidX.coreKtx, Libs.Coroutines.core ) + implementation project(':privacymodule-api') - implementation project(':api') testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' diff --git a/api/.gitignore b/privacymodule-api/.gitignore similarity index 100% rename from api/.gitignore rename to privacymodule-api/.gitignore diff --git a/api/build.gradle b/privacymodule-api/build.gradle similarity index 97% rename from api/build.gradle rename to privacymodule-api/build.gradle index b8ced307..e36f68e2 100644 --- a/api/build.gradle +++ b/privacymodule-api/build.gradle @@ -2,6 +2,8 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'maven-publish' +group 'foundation.e' + android { compileSdkVersion buildConfig.compileSdk @@ -38,9 +40,9 @@ dependencies { publishing { publications { maven(MavenPublication) { - groupId 'foundation.e' + groupId group //You can either define these here or get them from project conf elsewhere - artifactId 'privacymodule.api' + artifactId 'privacymodule-api' version buildConfig.version.name artifact "$buildDir/outputs/aar/api-release.aar" //aar artifact you want to publish diff --git a/api/consumer-rules.pro b/privacymodule-api/consumer-rules.pro similarity index 100% rename from api/consumer-rules.pro rename to privacymodule-api/consumer-rules.pro diff --git a/api/proguard-rules.pro b/privacymodule-api/proguard-rules.pro similarity index 100% rename from api/proguard-rules.pro rename to privacymodule-api/proguard-rules.pro diff --git a/api/src/main/AndroidManifest.xml b/privacymodule-api/src/main/AndroidManifest.xml similarity index 100% rename from api/src/main/AndroidManifest.xml rename to privacymodule-api/src/main/AndroidManifest.xml diff --git a/api/src/main/java/foundation/e/privacymodules/DependencyInjector.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/DependencyInjector.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/DependencyInjector.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/DependencyInjector.kt diff --git a/api/src/main/java/foundation/e/privacymodules/location/IFakeLocationModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/location/IFakeLocationModule.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/location/IFakeLocationModule.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/location/IFakeLocationModule.kt diff --git a/api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/APermissionsPrivacyModule.kt diff --git a/api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/IPermissionsPrivacyModule.kt diff --git a/api/src/main/java/foundation/e/privacymodules/permissions/data/AppOpModes.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/AppOpModes.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/permissions/data/AppOpModes.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/AppOpModes.kt diff --git a/api/src/main/java/foundation/e/privacymodules/permissions/data/ApplicationDescription.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/ApplicationDescription.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/permissions/data/ApplicationDescription.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/ApplicationDescription.kt diff --git a/api/src/main/java/foundation/e/privacymodules/permissions/data/PermissionDescription.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/PermissionDescription.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/permissions/data/PermissionDescription.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/permissions/data/PermissionDescription.kt diff --git a/api/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IBlockTrackersPrivacyModule.kt diff --git a/api/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/IDNSBlocker.kt diff --git a/api/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/ITrackTrackersPrivacyModule.kt diff --git a/api/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt b/privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt similarity index 100% rename from api/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt rename to privacymodule-api/src/main/java/foundation/e/privacymodules/trackers/Tracker.kt diff --git a/settings.gradle b/settings.gradle index 24b6eefd..547bbd14 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,6 +2,6 @@ include ':app' rootProject.name = "PrivacyCentralApp" include ':fakelocation' include ':fakelocation:fakelocationdemo' -include ':api' +include ':privacymodule-api' include ':permissionsstandalone' include ':trackers' diff --git a/trackers/build.gradle b/trackers/build.gradle index 51f8448b..dec05ff1 100644 --- a/trackers/build.gradle +++ b/trackers/build.gradle @@ -40,6 +40,7 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } } -dependencies{ - implementation project(":api") + +dependencies { + implementation project(':privacymodule-api') } -- GitLab From 3329567b1899c06d37dad6b4d808d35564e07410 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Wed, 17 Aug 2022 17:00:41 +0200 Subject: [PATCH 2/4] Update readme, fix build and deployy privacymodule-api . --- README.md | 14 ++++++++------ privacymodule-api/build.gradle | 9 ++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6a9ec45e..5cc125df 100644 --- a/README.md +++ b/README.md @@ -95,11 +95,13 @@ This app requires different modules that must be built indivually and pushed to modules must be build and deployed in the following order: -- [privacymodulesapi](../../../e_privacycentral_privacymodulesapi) -- [privacymodulese](../../../e_privacycentral_privacymodulese) -- [privacymoduletor](../../../e_privacycentral_privacymoduletor) -- [privacymoduletrackerfilter](../../../e_privacycentral_privacymoduletrackerfilter) - +- privacymodule-api : + - ./gradlew :privacymodule-api:assembleRelease + - ./gradlew --console=verbose publishToMavenLocal // To make it available locally for dev. + - ./gradlew --console=verbose publish // To publish it on gitlab for release. +- [privacymodule-e](../../../e_privacycentral_privacymodulese) +- [privacymodule-tor](../../../e_privacycentral_privacymoduletor) +- [app] ## Build If you'd like to build PrivacyCentral locally, you should be able to just clone and build with no issues. @@ -147,7 +149,7 @@ PrivacyCentral needs to be installed as system app and whitelisting in order to ### To run apk on stock android devices You can simply install the apk. Keep in that mind all features won't be available on stock android devices. -> Volla!!!, PrivacyCentral is installed successfully in your device. +> Voila !!!, PrivacyCentral is installed successfully in your device. # Distribution This project can be distributed as prebuilt apk with /e/OS or it can be published on other app stores for non /e/OS devices. diff --git a/privacymodule-api/build.gradle b/privacymodule-api/build.gradle index e36f68e2..c252e77f 100644 --- a/privacymodule-api/build.gradle +++ b/privacymodule-api/build.gradle @@ -40,11 +40,11 @@ dependencies { publishing { publications { maven(MavenPublication) { - groupId group + groupId 'foundation.e' //You can either define these here or get them from project conf elsewhere artifactId 'privacymodule-api' version buildConfig.version.name - artifact "$buildDir/outputs/aar/api-release.aar" + artifact "$buildDir/outputs/aar/privacymodule-api-release.aar" //aar artifact you want to publish //generate pom nodes for dependencies @@ -75,7 +75,10 @@ publishing { } } else { maven { - url "https://gitlab.e.foundation/api/v4/projects/900/packages/maven" +// url "https://gitlab.e.foundation/api/v4/projects/900/packages/maven" + // Use privacymodule-e repository (id = 781) for now, + // because repository not activated on Advanced Privacy (id = 900) + url "https://gitlab.e.foundation/api/v4/projects/781/packages/maven" credentials(HttpHeaderCredentials) { name = "Private-Token" value = gitLabPrivateToken -- GitLab From 060bd32654132f4d9d3fa59e8a14ed5fdad25441 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Wed, 17 Aug 2022 17:32:39 +0200 Subject: [PATCH 3/4] Remove commented code. --- app/build.gradle | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 71d0f804..5d51b523 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -114,15 +114,8 @@ dependencies { implementation project(':privacymodule-api') standaloneImplementation project(':permissionsstandalone') - e29Implementation('foundation.e:privacymodule-e-29:1.2.0') -// { -// exclude group: 'foundation.e', module: 'privacymodule-api' -// } - e30Implementation('foundation.e:privacymodule-e-30:1.2.0') -// { -// exclude group: 'foundation.e', module: 'privacymodule-api' -// } - + e29Implementation 'foundation.e:privacymodule-e-29:1.2.0' + e30Implementation 'foundation.e:privacymodule-e-30:1.2.0' implementation project(':fakelocation') e29CompileOnly files('libs/e-ui-sdk-1.0.1-q.jar') -- GitLab From 4cce788035eb395228e0371c244ef6a80f6006c0 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Thu, 18 Aug 2022 08:09:59 +0200 Subject: [PATCH 4/4] Add copyright header on gradle files. --- app/build.gradle | 17 +++++++++++++++++ build.gradle | 17 +++++++++++++++++ dependencies.gradle | 17 +++++++++++++++++ privacymodule-api/build.gradle | 17 +++++++++++++++++ 4 files changed, 68 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 5d51b523..9cfc65b3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2022 E FOUNDATION + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + plugins { id 'com.android.application' id 'kotlin-android' diff --git a/build.gradle b/build.gradle index 5222057f..ec8cf145 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2022 E FOUNDATION + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import foundation.e.privacycentral.buildsrc.DependencyUpdates import foundation.e.privacycentral.buildsrc.ReleaseType diff --git a/dependencies.gradle b/dependencies.gradle index ed329c78..6c4acb31 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2022 E FOUNDATION + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + def libs = [:] ext.Libs = libs diff --git a/privacymodule-api/build.gradle b/privacymodule-api/build.gradle index c252e77f..c0b1303d 100644 --- a/privacymodule-api/build.gradle +++ b/privacymodule-api/build.gradle @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2022 E FOUNDATION + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'maven-publish' -- GitLab