Bitmask Core
This repository contains all golang dependencies currently used in Bitmask Android and custom branded versions of it:
- obfsvpn: a library containing different obfs4 based censorship circumvention transports
- IPtProxy: a library wrapping snowflake client and snowflake proxy, forked from https://github.com/tladesignz/IPtProxy and adapted for our purposes
- pgpverify: a small library for verifying the integrity of downloaded app updates (only used in apks distributed from a website)
- motd: Message of the day library, shared between Bitmask Desktop and Mobile
- more shared code between Bitmask Desktop and Mobile clients (tbd.)
Run the follwing command to build Bitmask Core for all Android build flavors (runs currently only on Linux 64-bit distros):
./build_core.sh
Adding new go libraries
- In order to add new library we currently add them as git submodules.
git submodule add git://<repository_url.git> <new_lib_directory>
-
Most of the time the new library has its own
go.mod
andgo.sum
file. You need to copy and paste allrequired
dependencies from the new librariesgo.mod
to thego.mod
in the bitmaskcore directory. Similarly, you have also to take care aboutreplace
entries. -
delete
go.mod
andgo.sum
from the new library
# you should be in bitmaskcore
cd <new_lib_directory>
rm go.mod go.sum
- create a patch from the diff
# you should be in bitmaskcore/<new_lib_directory>
git diff > ../<new_lib>.patch
git stash
cd ..
- Make sure the
bitmaskcore/golang
directory is empty.
# you should be in bitmaskcore
rm -rf ./golang/*
- And let go add any missing modules.
# you should be in bitmaskcore
go mod tidy
- Update build_core.sh and add some lines of code below the exting patches section
# -------- preparing <new_lib> ---------------
showtitle "Applying patch to <new_lib>"
patch --directory=<new_lib_directory> --strip=1 < <new_lib>.patch || quit
-
git add
your changes and commit them - run
./build_core.sh
and make sure it succeeds