Opened 5 months ago

Last modified 2 weeks ago

#28672 new project

Android reproducible build of Snowflake

Reported by: dcf Owned by:
Priority: Medium Milestone:
Component: Obfuscation/Snowflake Version:
Severity: Normal Keywords: android, TorBrowserTeam201904, GeorgKoppen201904
Cc: dcf, arlolra, eighthave, gk Actual Points:
Parent ID: #19001 Points:
Reviewer: Sponsor: Sponsor19

Description

This ticket is for tracking the progress of porting Snowflake to Android.

Child Tickets

Change History (10)

comment:1 Changed 5 months ago by dcf

Cc: eighthave added

Hans-Christoph did the bulk of porting both go-webrtc and Snowflake to Android. The process is narrated in #28205 and culminated in

The current status, as I understand it, is that the build is reproducible, but includes or at least downloads the proprietary Google Play Services library as a side effect of the build.

comment:2 Changed 5 months ago by gk

Cc: gk added

comment:3 Changed 5 months ago by pili

Parent ID: #19001

comment:4 Changed 5 months ago by pili

Sponsor: Sponsor19

comment:5 in reply to:  1 Changed 3 months ago by dcf

Replying to dcf:

The current status, as I understand it, is that the build is reproducible, but includes or at least downloads the proprietary Google Play Services library as a side effect of the build.

The android changes are now merged into go-webrtc. We found a workaround for the Google Play services problem.

comment:6 Changed 6 weeks ago by gk

dcf: do you have a script/instructions somewhere on how to build the whole thing which we could then translate into our tor-browser-build process? If you plan to do that work yourself, you are more than welcome! :). We'll likely put that on our plate otherwise.

comment:7 Changed 6 weeks ago by eighthave

You can see build instructions for various platforms by looking at the .gitlab-ci.yml file:
https://github.com/keroserene/snowflake/blob/master/.gitlab-ci.yml

These will build the Go code using the libwebrtc binaries included in the git repo.

comment:8 Changed 6 weeks ago by eighthave

Oops, I guess my .gitlab-ci.yml never got merged upstream, you can see the android build in my fork:
https://gitlab.com/eighthave/snowflake/blob/master/.gitlab-ci.yml

comment:9 in reply to:  6 Changed 6 weeks ago by dcf

Replying to gk:

dcf: do you have a script/instructions somewhere on how to build the whole thing which we could then translate into our tor-browser-build process? If you plan to do that work yourself, you are more than welcome! :). We'll likely put that on our plate otherwise.

I didn't do anything beyond making sure that go-webrtc and snowflake would compile for Android, because I don't know how the pluggable transport integration works on Android. eighthave was showing us a gomobile bind setup that doesn't use separate executables (requires patching out package main) and I didn't know if that was how it was going to be done.

I think that go-webrtc will only require minor changes in projects/webrtc/config and projects/snowflake/config. Here you can see the changes we made in the upstream build script:

https://github.com/keroserene/go-webrtc/pull/90/files#diff-0b83f9dedf40d7356e5ca147a077acb4

In projects/webrtc/config:

  • Set TARGET_OS=android TARGET_CPU=arm
  • Append target_os = [ 'android' ] to .gclient. I think it's safe to do across all targets, as it only affects what gets downloaded.
  • In gclient sync, echo n to not agree to the proprietary Google Play services license (also prevents the Play libraries from downloading). You could alternately patch out this check, etc.
  • In gn gen, set symbol_level=0. This is needed to actually disable debugging symbols; otherwise the libwebrtc is like 100 MB.
  • Upstream we are using Google's prebuilt arm-linux-androideabi-ar, but it would be better to build your own.

In projects/snowflake/config:

  • Set GOOS=android GOARCH=arm.
  • You may have to copy webrtc-android-armeabi-v7a.pc over webrtc-linux-arm.pc, as in eighthave's script.

comment:10 Changed 2 weeks ago by gk

Keywords: TorBrowserTeam201904 GeorgKoppen201904 added
Note: See TracTickets for help on using tickets.