Skip to content

Conversation

@ohnorobo
Copy link
Contributor

@ohnorobo ohnorobo commented Dec 16, 2025

Additional fixes to #2678

This does not fix the overall build issue. However it does fix the UNALIGNED libgojni.so issue described here. So I'm not sure if this is the correct solution, or something we want to add. (Maybe the UNALIGNED libgojni.so files are fine.)

TESTING

ran a release build, then

./check_elf_alignment.sh Outline-Client.apk

Recursively analyzing Outline-Client.apk

NOTICE: Zip alignment check requires build-tools version 35.0.0-rc3 or higher.
  You can install the latest build-tools by running the below command
  and updating your $PATH:

    sdkmanager "build-tools;35.0.0-rc3"

=== ELF alignment ===
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/armeabi-v7a/libsentry.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/armeabi-v7a/libgojni.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/armeabi-v7a/libsentry-android.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/x86/libsentry.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/x86/libgojni.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/x86/libsentry-android.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/arm64-v8a/libsentry.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/arm64-v8a/libgojni.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/arm64-v8a/libsentry-android.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/x86_64/libsentry.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/x86_64/libgojni.so: \e[32mALIGNED\e[0m (2**14)
/var/folders/_s/1987wtss17b34gz5sv0f3mfm007mzb/T/Outline-Client_out_XXXXX.jTsVyC9Xqa/lib/x86_64/libsentry-android.so: \e[32mALIGNED\e[0m (2**14)
ELF Verification Successful

./check_elf_alignment.sh Outline-Client.apk | grep UNALIGNED
[no output]
=====================

However I'm still getting the error
image
when uploading the APK to the play store.

@ohnorobo ohnorobo requested a review from fortuna December 16, 2025 15:30
@ohnorobo ohnorobo requested a review from jyyi1 December 16, 2025 16:09
BIN_DIR: '{{joinPath .OUT_DIR "/bin"}}'
MOBILE_PKG: "{{.TASKFILE_DIR}}/outline/tun2socks"
GOMOBILE_BIND_CMD: "env PATH=\"{{.BIN_DIR}}:${PATH}\" CGO_CFLAGS='-fstack-protector-strong' '{{.BIN_DIR}}/gomobile' bind -ldflags='-s -w'"
GOMOBILE_BIND_CMD: "env PATH=\"{{.BIN_DIR}}:${PATH}\" CGO_CFLAGS='-fstack-protector-strong -falign-functions=16 -falign-loops=16' CGO_LDFLAGS='-Wl,-z,max-page-size=16384 -Wl,-z,common-page-size=16384' '{{.BIN_DIR}}/gomobile' bind -ldflags='-s -w'"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try upgrading Go Mobile before we move forward from with this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried here, but it also didn't seem to help.

@ohnorobo
Copy link
Contributor Author

@ohnorobo
Copy link
Contributor Author

ohnorobo commented Jan 5, 2026

This change was superseded by the change of running

~/Library/Android/sdk/build-tools/36.0.0/zipalign -P 16 -f -v 4 client/platforms/android/app/build/outputs/bundle/release/app-release.aab client/platforms/android/app/build/outputs/bundle/release/app-release-zipaligned.aab

to force zipalignment in the libraries at issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants