This guide contains development related information to help a developer in getting better understanding of project structure.
## Architecture
The architecture of PrivacyCentralApp is based on [clean architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html). For presentation layer, we use [Model-View-Intent](http://hannesdorfmann.com/android/model-view-intent/) design pattern which is a unidirectional reactive flow pattern. We use it in conjunction to ViewModel to make our features lifecycle aware. Our android app is having single activity multiple fragments.
The architecture of AdvancedPrivacy is based on [clean architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html). For presentation layer, we use [Model-View-Intent](http://hannesdorfmann.com/android/model-view-intent/) design pattern which is a unidirectional reactive flow pattern. We use it in conjunction to ViewModel to make our features lifecycle aware. Our android app is having single activity multiple fragments.
### Clean Architecture
Clean architecture is the building block of PrivacyCentralApp. This architecture is based on the following principles:
Clean architecture is the building block of AdvancedPrivacy. This architecture is based on the following principles:
1.**Independent of Frameworks**. The architecture does not depend on the existence of some library of feature laden software. This allows you to use such frameworks as tools, rather than having to cram your system into their limited constraints.
2.**Testable**. The business rules can be tested without the UI, Database, Web Server, or any other external element.
3.**Independent of UI**. The UI can change easily, without changing the rest of the system. A Web UI could be replaced with a console UI, for example, without changing the business rules.
@@ -19,7 +19,7 @@ Clean architecture is the building block of PrivacyCentralApp. This architecture
MVI is used at the presentation layer of clean architecture. It is very much similar to [Redux](https://redux.js.org/) in terms of implementation and working. It has three main components.
-**View**: This is where activities, fragments and other android components live. It is responsible for publishing user intent/actions to the model and rendering the state returned by the model. In PrivacyCentralApp, it is just an interface which is implemented by android components.
-**View**: This is where activities, fragments and other android components live. It is responsible for publishing user intent/actions to the model and rendering the state returned by the model. In AdvancedPrivacy, it is just an interface which is implemented by android components.
-**Intent**: In context of our app, we call them actions. These are simple data classes having any extra payload like inputs, ids etc.
-**Model (data layer at presentation level)**: This is responsible for processing the actions, communicating with domain use-cases and mutating the state of the model. It acts as a Store from redux but for our use case, we call it a **Feature**.
@@ -33,7 +33,7 @@ Elements of a feature:
2.**State**: Simple POJO (kotlin data class) representing various UI states of the application.
3.**SingleEventProducer**: This is a function which is invoked by the reducer to publish single events (that can/should only be consumed once like displaying toast, snackbar message or sending an analytics event). This function takes action, effect, current state as input and it returns a `SingleEvent`. By default this function is null for any Feature.
@@ -115,6 +114,18 @@ For building from CLI, you can execute this command:
You can build the apk locally by using above instructions or you can download the latest stable apk from `master` branch pipeline.
### To run apk on /e/OS devices
If you are running your tests on a `/test` build, the debug buildtype already sign it with the appropriate key, and without the persistant flag, to allow further updates.
But the first time, to replace the AdvancedPrivacy app, embeded in the test build, you have to use the following commands:
#### AdvancedPrivacy requiement against the system
AdvancedPrivacy needs to be installed as system app and whitelisting in order to grant some system specific permissions. Follow these steps to make it work properly on /e/OS
1. From `Developer options`, enable `Android debugging` and `Rooted debugging`
@@ -133,13 +144,13 @@ AdvancedPrivacy needs to be installed as system app and whitelisting in order to
```
1. Push permissions whitelist.
- it requires the whitelisting [privapp-permissions-foundation.e.privacycentralapp.xml](privapp-permissions-foundation.e.privacycentralapp.xml) file that can be found in the project repository.
- it requires the whitelisting [privapp-permissions-foundation.e.advancedprivacy.xml](privapp-permissions-foundation.e.advancedprivacy.xml) file that can be found in the project repository.
1. Allow the fake location service to run in background. Add <allow-in-power-savepackage="foundation.e.privacycentralapp.e"/> in the file /system/etc/permissions/platform.xml .
1. Allow the fake location service to run in background. Add <allow-in-power-savepackage="foundation.e.advancedprivacy"/> in the file /system/etc/permissions/platform.xml .