Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
  • integrate_bitmask-core
  • tun2torsocks_rebase
  • fix_osx_golang_download2
  • fix_osx_golang_download
  • vpn-hole-patch
  • tun2torsocks
  • shapeshifter_as_a_module
8 results

bitmaskcore

  • Clone with SSH
  • Clone with HTTPS
  • 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

    1. In order to add new library we currently add them as git submodules.
    git submodule add git://<repository_url.git> <new_lib_directory>
    1. Most of the time the new library has its own go.mod and go.sum file. You need to copy and paste all required dependencies from the new libraries go.mod to the go.mod in the bitmaskcore directory. Similarly, you have also to take care about replace entries.

    2. delete go.mod and go.sum from the new library

    # you should be in bitmaskcore
    cd <new_lib_directory>
    rm go.mod go.sum
    1. create a patch from the diff
    # you should be in bitmaskcore/<new_lib_directory>
    git diff > ../<new_lib>.patch
    git stash
    cd ..
    1. Make sure the bitmaskcore/golang directory is empty.
    # you should be in bitmaskcore
    rm -rf ./golang/* 
    1. And let go add any missing modules.
    # you should be in bitmaskcore
    go mod tidy
    1. 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
    1. git add your changes and commit them
    2. run ./build_core.sh and make sure it succeeds