x/v0.0.8: [BREAKING] Extensible Mobile Proxy
In this release we made the Mobile Proxy extensible: it's now possible to add new fallback strategies without making changes to the Mobile Proxy itself. This means any 3rd party can directly provide strategies to apps.
Provide Registration Function
To provide a new strategy, you will typically provide a Go function to register your config parser with the strategy finder. See RegisterFallbackParser in the x/mobileproxy/psiphon package as an example.
Add to Compilation
Then, make sure you include the package with the strategy in your Go Mobile compilation. To build the Mobile Proxy library with Psiphon, include github.com/Jigsaw-Code/outline-sdk/x/mobileproxy/psiphon in the gomobile bind call:
PATH="$(pwd)/out:$PATH" gomobile bind -ldflags='-s -w' -target=ios -iosversion=11.0 -tags=psiphon -o "$(pwd)/out/mobileproxy.xcframework" github.com/Jigsaw-Code/outline-sdk/x/mobileproxy github.com/Jigsaw-Code/outline-sdk/x/mobileproxy/psiphon
PATH="$(pwd)/out:$PATH" gomobile bind -ldflags='-s -w' -target=android -androidapi=21 -tags=psiphon -o "$(pwd)/out/mobileproxy.aar" github.com/Jigsaw-Code/outline-sdk/x/mobileproxy github.com/Jigsaw-Code/outline-sdk/x/mobileproxy/psiphonCall Registration Function
Finally, in your mobile code, call the registration function on the SmartDialer options like so:
val options = Mobileproxy.newSmartDialerOptions(testDomains, config)
Psiphon.registerFallbackParser(options, "psiphon")let options = MobileproxyNewSmartDialerOptions(testDomains, config)
PsiphonRegisterFallbackParser(options, "psiphon")Note that the function takes the package name as the prefix (Psiphon, not Mobileproxy).
This change breaks how the Psiphon integration worked. You now have to explicitly register it following the recipe above.
What's Changed
- docs(x/tools): update fetch command examples in README.md by @fortuna in #524
- feat(x): make Psiphon Start supersede previous Start by @fortuna in #530
- chore: point Mobileproxy readme to new repositories by @daniellacosse in #533
- feat(x/mobileproxy): make Mobileproxy extensible by @fortuna in #528
- fix(x): fix MobileProxy fallback registration by @fortuna in #535
Full Changelog: x/v0.0.7...x/v0.0.8