Restructure development 101

Sebastian Kürten
2020-12-02 14:55:11 +01:00
parent a70e445c3d
commit 0f10e25f58

@@ -3,19 +3,50 @@
A page for things everyone hacking on briar should know. If you don't find something in here,
also check the [Development](https://code.briarproject.org/briar/briar/-/wikis/home#development) section on the main Wiki page.
## Entering your password automatically
## A few hints for the development/debug workflow
### Entering your password automatically
During development you may find yourself having to enter your briar password very often which can be tedious. It can be helpful to enter the password from your development machine's command line instead:
adb shell input text your-password && adb shell input keyevent 66
## Working with the Gradle Witness
### Running multiple versions of Briar on a single device
Running two versions of Briar side by side on one device does not work out
of the box. For example it is not possible to run the released version and
the development version at the same time; only one of both will be online.
The reason is that the both versions are trying to use the same hard-coded
Tor ports to create their hidden service, which doesn't work. The solution
is to use different ports on the development versions. To do so, change the
following:
In `bramble-api/src/main/java/org/briarproject/bramble/api/plugin/TorConstants.java`:
- int SOCKS_PORT = 59050;
- int CONTROL_PORT = 59051;
+ int SOCKS_PORT = 59060;
+ int CONTROL_PORT = 59061;
In `bramble-core/src/main/resources/torrc`:
- ControlPort 59051
+ ControlPort 59061
...
- SocksPort 59050
+ SocksPort 59060
## Fixing common problems
### Working with the Gradle Witness
The project uses the Gradle Witness to make sure third party dependencies have not been tampered with. If you encounter problems with this feature, for example after upgrading dependencies, it may be required to recalculate the checksums:
./update-dependency-pinning.sh
## Patterns for visibility and interfaces
## Coding patterns
### Patterns for visibility and interfaces
As an addition to the points noted in the
[pre review checklist](https://code.briarproject.org/briar/briar/-/wikis/pre-review-checklist):
@@ -41,28 +72,3 @@ There are a few exceptions to this convention:
Additionally we sometimes also use interfaces within packages.
It can help establishing a clearer separation of concerns and easier testing
when there's complex interaction between classes.
## Running multiple versions of Briar on a single device
Running two versions of Briar side by side on one device does not work out
of the box. For example it is not possible to run the released version and
the development version at the same time; only one of both will be online.
The reason is that the both versions are trying to use the same hard-coded
Tor ports to create their hidden service, which doesn't work. The solution
is to use different ports on the development versions. To do so, change the
following:
In `bramble-api/src/main/java/org/briarproject/bramble/api/plugin/TorConstants.java`:
- int SOCKS_PORT = 59050;
- int CONTROL_PORT = 59051;
+ int SOCKS_PORT = 59060;
+ int CONTROL_PORT = 59061;
In `bramble-core/src/main/resources/torrc`:
- ControlPort 59051
+ ControlPort 59061
...
- SocksPort 59050
+ SocksPort 59060