Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android: ipc -> ffi #1

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,23 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: '1.21.1'
- name: Set up gomobile
run: |
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Build imessage.so
run: ./android/imessage.sh
- name: Build AAR
run: ./android/gradlew -p android :library:assembleRelease
- name: Publish to GitHub Packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./android/gradlew -p android :library:publish
run: gomobile bind -target=android -androidapi 26 -o imessage.aar ./imessage/ffi
# - name: Publish to GitHub Packages
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: ./android/gradlew -p android :library:publish
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: aar
path: ./android/library/build/outputs/aar/library-release.aar
path: imessage.aar
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@
/beeper-imessage
/start
/.android-ipc-bin
/imgo.h
/imgo.so

/imessage-sources.jar
/imessage.aar
3 changes: 1 addition & 2 deletions android-ipc → android-ffi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ set -e
repo_dir=$(dirname $(realpath $0))
pushd $repo_dir > /dev/null
LDFLAGS="-X main.Tag=$(git describe --exact-match --tags 2>/dev/null) -X main.Commit=$(git rev-parse HEAD) -X 'main.BuildTime=$(date '+%b %_d %Y, %H:%M:%S')'"
go build -ldflags "$LDFLAGS" -o .android-ipc-bin ./imessage/ipc/
go build -ldflags "$LDFLAGS" -buildmode=c-shared -o imgo.so ./imessage/ffi/
popd > /dev/null
rlwrap -H "$HOME/.android-ipc_history" $repo_dir/.android-ipc-bin 2> >(zeroparse >&2) | (trap '' INT; jq -c)
15 changes: 0 additions & 15 deletions android/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions android/build.gradle.kts

This file was deleted.

23 changes: 0 additions & 23 deletions android/gradle.properties

This file was deleted.

Binary file removed android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 0 additions & 6 deletions android/gradle/wrapper/gradle-wrapper.properties

This file was deleted.

185 changes: 0 additions & 185 deletions android/gradlew

This file was deleted.

89 changes: 0 additions & 89 deletions android/gradlew.bat

This file was deleted.

Loading