Skip to content

Commit

Permalink
Merge branch 'master' into staging-client
Browse files Browse the repository at this point in the history
  • Loading branch information
rod-hynes committed Apr 17, 2020
2 parents baf0e9f + a6d1594 commit 14216ef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Binary file not shown.
20 changes: 17 additions & 3 deletions MobileLibrary/Android/make.bash
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,23 @@ echo " Gomobile version: ${GOMOBILEVERSION}"
echo " Dependencies: ${DEPENDENCIES}"
echo ""

# Note: android/386 is x86 and android/amd64 is x86_64
gomobile bind -v -x -target=android/arm,android/arm64,android/386,android/amd64 -tags="${BUILD_TAGS}" -ldflags="$LDFLAGS" github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/psi
# Note: android/386 is x86, which is used on both x86 and x86_64 Android
# devices. We are excluding the android/amd64, x86_64, ABI as it causes a
# crash in Android x86_64 emulators: "seccomp prevented call to disallowed
# x86_64 system call 22". x86/linux syscall 22 is pipe.
#
# In Android seccomp config, pipe is permitted only for 32-bit platforms:
# https://android.googlesource.com/platform/bionic/+/2b499046f10487802bfbaaf4429160595d08b22c/libc/SECCOMP_WHITELIST_APP.TXT#7.
#
# The Go syscall.Pipe on linux(android)/amd64 is the disallowed pipe:
# https://github.com/golang/go/blob/release-branch.go1.14/src/syscall/syscall_linux_amd64.go#L115-L126
#
# A potential future fix is to use the allowed pipe2,
# https://android.googlesource.com/platform/bionic/+/2b499046f10487802bfbaaf4429160595d08b22c/libc/SYSCALLS.TXT#129,
# which is what linux(android)/arm64 uses, for example:
# https://github.com/golang/go/blob/release-branch.go1.14/src/syscall/syscall_linux_arm64.go#L150-L159.

gomobile bind -v -x -target=android/arm,android/arm64,android/386 -tags="${BUILD_TAGS}" -ldflags="$LDFLAGS" github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/psi
if [ $? != 0 ]; then
echo "..'gomobile bind' failed, exiting"
exit $?
Expand All @@ -64,7 +79,6 @@ yes | cp -f PsiphonTunnel/AndroidManifest.xml build-tmp/psi/AndroidManifest.xml
yes | cp -f PsiphonTunnel/libs/armeabi-v7a/libtun2socks.so build-tmp/psi/jni/armeabi-v7a/libtun2socks.so
yes | cp -f PsiphonTunnel/libs/arm64-v8a/libtun2socks.so build-tmp/psi/jni/arm64-v8a/libtun2socks.so
yes | cp -f PsiphonTunnel/libs/x86/libtun2socks.so build-tmp/psi/jni/x86/libtun2socks.so
yes | cp -f PsiphonTunnel/libs/x86_64/libtun2socks.so build-tmp/psi/jni/x86_64/libtun2socks.so
mkdir -p build-tmp/psi/res/xml
yes | cp -f PsiphonTunnel/ca_psiphon_psiphontunnel_backup_rules.xml build-tmp/psi/res/xml/ca_psiphon_psiphontunnel_backup_rules.xml

Expand Down

0 comments on commit 14216ef

Please sign in to comment.