|
|
||
|---|---|---|
| armor | ||
| constants | ||
| crypto | ||
| dist/Android | ||
| internal | ||
| key | ||
| models | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| build.sh | ||
| Changelog.md | ||
| glide.lock | ||
| glide.yaml | ||
| notes.txt | ||
| README.md | ||
Common client library for cryptography
this should be imported in go as github.com/ProtonMail/go-pm-crypto
setup gomobile and build/bind the source code:
Gomobile repo: https://github.com/golang/mobile Gomobile wiki: https://github.com/golang/go/wiki/Mobile ProtonMail Openpgp: https://github.com/ProtonMail/crypto/tree/master/openpgp
-
Install Go: brew install go
-
Install Gomobile: go get golang.org/x/mobile/cmd/gomobile //go get -u golang.org/x/mobile/cmd/...
-
Install Gobind: go install golang.org/x/mobile/cmd/gobind
-
Install android sdk and ndk use android studio
-
Set Env: export ANDROID_HOME="/AndroidSDK" #set your own path
-
Init gomobile: gomobile init -ndk /AndroidSDK/ndk-bundle/ #put your own ndk path
-
build examples: gomobile build -target=android #or ios
bind examples: gomobile bind -target ios -o frameworks/name.framework gomobile bind -target android
the bind will create framework for ios and jar&aar file for android x86_64 arm arch
- Project uses glide to setup vendor
OTHER NOTES: two way bridge go & swift: https://medium.com/@matryer/tutorial-calling-go-code-from-swift-on-ios-and-vice-versa-with-gomobile-7925620c17a4
SOME UNSOLVED ISSUES: No Mips support but this is fine we don't support it anyway https://github.com/golang/go/issues/23692 issue with atomic EXC_BAD_ACCESS is hard to catch https://github.com/golang/go/issues/21288 memory issue https://github.com/golang/go/issues/21594 gradle issue https://github.com/golang/go/issues/23307 https://github.com/golang/go/issues/20241 upload failed. we are using framework need to confirm this https://github.com/golang/go/issues/17278 android load jni issue https://github.com/golang/go/issues/17807 dlopen issue https://github.com/golang/go/issues/18903 doesn't work well with vender https://github.com/golang/go/issues/13438 bind issue https://github.com/golang/go/issues/14332 build types issue https://github.com/golang/go/issues/15956 no multiple independent bindings support
The build.sh need to modify the path when you use it