Skip to content

Commit 91ea292

Browse files
xaionaro@dx.centerxaionaro@dx.center
authored andcommitted
feat: initialize jni-proxy repo with gRPC proxy code split from jni
Move gRPC proxy-related code from AndroidGoLab/jni into this dedicated repository: cmd/{jnicli,jniservice,jniserviceadmin}, grpc/, proto/, handlestore/, tests/e2e-grpc/, tools/{cmd,pkg}/callbackgen, spec/callbacks.yaml, and CI workflows. All import paths updated from github.com/AndroidGoLab/jni/ to github.com/AndroidGoLab/jni-proxy/ for moved packages; imports referencing core JNI bindings (app/, capi/, location/, etc.) remain pointing to github.com/AndroidGoLab/jni.
0 parents  commit 91ea292

410 files changed

Lines changed: 718498 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/e2e.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: E2E Tests (Android Emulator)
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 6 * * 1'
7+
8+
jobs:
9+
e2e:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 30
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-go@v5
17+
with:
18+
go-version: '1.24'
19+
cache: true
20+
21+
- name: Set up JDK 17
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: temurin
25+
java-version: '17'
26+
27+
- name: Set up Android SDK
28+
uses: android-actions/setup-android@v3
29+
30+
- name: Install Android NDK
31+
run: sdkmanager --install "ndk;27.0.12077973"
32+
33+
- name: Run E2E tests on emulator
34+
uses: reactivecircus/android-emulator-runner@v2
35+
with:
36+
api-level: 34
37+
arch: x86_64
38+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
39+
script: make test-emulator ARCH=x86_64
40+
env:
41+
ANDROID_SDK: /usr/local/lib/android/sdk
42+
NDK: /usr/local/lib/android/sdk/ndk/27.0.12077973

.github/workflows/release.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build release artifacts
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
goarch: [arm64, amd64]
18+
include:
19+
- goarch: arm64
20+
abi: arm64-v8a
21+
- goarch: amd64
22+
abi: x86_64
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: actions/setup-go@v5
28+
with:
29+
go-version: '1.24'
30+
cache: true
31+
32+
- name: Set up JDK 17
33+
uses: actions/setup-java@v4
34+
with:
35+
distribution: temurin
36+
java-version: '17'
37+
38+
- name: Set up Android SDK
39+
uses: android-actions/setup-android@v3
40+
41+
- name: Install Android NDK and build-tools
42+
run: sdkmanager --install "ndk;27.0.12077973" "build-tools;35.0.0" "platforms;android-35"
43+
44+
- name: Build all artifacts
45+
run: make dist magisk
46+
env:
47+
DIST_GOARCH: ${{ matrix.goarch }}
48+
ANDROID_SDK: /usr/local/lib/android/sdk
49+
DIST_NDK: /usr/local/lib/android/sdk/ndk/27.0.12077973
50+
51+
- name: Decode signing keystore
52+
run: |
53+
if [ -n "$JNISERVICE_KEYSTORE_B64" ]; then
54+
echo "$JNISERVICE_KEYSTORE_B64" | base64 -d > build/release.keystore
55+
fi
56+
env:
57+
JNISERVICE_KEYSTORE_B64: ${{ secrets.JNISERVICE_KEYSTORE_B64 }}
58+
59+
- name: Build APK
60+
run: |
61+
EXTRA_ENV=""
62+
if [ -f build/release.keystore ]; then
63+
export JNISERVICE_KEYSTORE=build/release.keystore
64+
export JNISERVICE_KEYSTORE_PASSWORD="${KS_PASSWORD}"
65+
fi
66+
make apk
67+
env:
68+
DIST_GOARCH: ${{ matrix.goarch }}
69+
ANDROID_SDK: /usr/local/lib/android/sdk
70+
DIST_NDK: /usr/local/lib/android/sdk/ndk/27.0.12077973
71+
KS_PASSWORD: ${{ secrets.JNISERVICE_KEYSTORE_PASSWORD }}
72+
73+
- name: Prepare release artifacts with descriptive names
74+
run: |
75+
mkdir -p release
76+
TAG="${GITHUB_REF_NAME}"
77+
ABI="${{ matrix.abi }}"
78+
79+
# CLI tool for Linux hosts
80+
cp build/jnicli-linux-${{ matrix.goarch }} \
81+
"release/jnicli-${TAG}-linux-${{ matrix.goarch }}"
82+
83+
# CLI tool for Android devices
84+
cp build/jnicli-android-${{ matrix.goarch }} \
85+
"release/jnicli-${TAG}-android-${ABI}"
86+
87+
# Admin tool for Android devices
88+
cp build/jniserviceadmin-android-${{ matrix.goarch }} \
89+
"release/jniserviceadmin-${TAG}-android-${ABI}"
90+
91+
# APK installer (no root required)
92+
cp build/jniservice-${ABI}.apk \
93+
"release/jniservice-${TAG}-${ABI}.apk"
94+
95+
# Magisk module (rooted devices, auto-start on boot)
96+
cp build/jniservice-magisk-${ABI}.zip \
97+
"release/jniservice-magisk-${TAG}-${ABI}.zip"
98+
99+
ls -la release/
100+
101+
- name: Upload artifacts
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: release-${{ matrix.goarch }}
105+
path: release/
106+
107+
release:
108+
name: Create GitHub release
109+
needs: build
110+
runs-on: ubuntu-latest
111+
steps:
112+
- name: Download all artifacts
113+
uses: actions/download-artifact@v4
114+
with:
115+
path: artifacts
116+
merge-multiple: true
117+
118+
- name: List artifacts
119+
run: find artifacts -type f | sort
120+
121+
- name: Create release
122+
uses: softprops/action-gh-release@v2
123+
with:
124+
generate_release_notes: true
125+
files: |
126+
artifacts/**/*

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/build/
2+
/tests/e2e-grpc/build/
3+
/build_info
4+
*.so
5+
cover.out
6+
examples/test_results/
7+
go.work
8+
go.work.sum

LICENSE

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Creative Commons Legal Code
2+
3+
CC0 1.0 Universal
4+
5+
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6+
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7+
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8+
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9+
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10+
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11+
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12+
HEREUNDER.
13+
14+
Statement of Purpose
15+
16+
The laws of most jurisdictions throughout the world automatically confer
17+
exclusive Copyright and Related Rights (defined below) upon the creator
18+
and subsequent owner(s) (each and all, an "owner") of an original work of
19+
authorship and/or a database (each, a "Work").
20+
21+
Certain owners wish to permanently relinquish those rights to a Work for
22+
the purpose of contributing to a commons of creative, cultural and
23+
scientific works ("Commons") that the public can reliably and without fear
24+
of later claims of infringement build upon, modify, incorporate in other
25+
works, reuse and redistribute as freely as possible in any form whatsoever
26+
and for any purposes, including without limitation commercial purposes.
27+
These owners may contribute to the Commons to promote the ideal of a free
28+
culture and the further production of creative, cultural and scientific
29+
works, or to gain reputation or greater distribution for their Work in
30+
part through the use and efforts of others.
31+
32+
For these and/or other purposes and motivations, and without any
33+
expectation of additional consideration or compensation, the person
34+
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35+
is an owner of Copyright and Related Rights in the Work, voluntarily
36+
elects to apply CC0 to the Work and publicly distribute the Work under its
37+
terms, with knowledge of his or her Copyright and Related Rights in the
38+
Work and the meaning and intended legal effect of CC0 on those rights.
39+
40+
1. Copyright and Related Rights. A Work made available under CC0 may be
41+
protected by copyright and related or neighboring rights ("Copyright and
42+
Related Rights"). Copyright and Related Rights include, but are not
43+
limited to, the following:
44+
45+
i. the right to reproduce, adapt, distribute, perform, display,
46+
communicate, and translate a Work;
47+
ii. moral rights retained by the original author(s) and/or performer(s);
48+
iii. publicity and privacy rights pertaining to a person's image or
49+
likeness depicted in a Work;
50+
iv. rights protecting against unfair competition in regards to a Work,
51+
subject to the limitations in paragraph 4(a), below;
52+
v. rights protecting the extraction, dissemination, use and reuse of data
53+
in a Work;
54+
vi. database rights (such as those arising under Directive 96/9/EC of the
55+
European Parliament and of the Council of 11 March 1996 on the legal
56+
protection of databases, and under any national implementation
57+
thereof, including any amended or successor version of such
58+
directive); and
59+
vii. other similar, equivalent or corresponding rights throughout the
60+
world based on applicable law or treaty, and any national
61+
implementations thereof.
62+
63+
2. Waiver. To the greatest extent permitted by, but not in contravention
64+
of, applicable law, Affirmer hereby overtly, fully, permanently,
65+
irrevocably and unconditionally waives, abandons, and surrenders all of
66+
Affirmer's Copyright and Related Rights and associated claims and causes
67+
of action, whether now known or unknown (including existing as well as
68+
future claims and causes of action), in the Work (i) in all territories
69+
worldwide, (ii) for the maximum duration provided by applicable law or
70+
treaty (including future time extensions), (iii) in any current or future
71+
medium and for any number of copies, and (iv) for any purpose whatsoever,
72+
including without limitation commercial, advertising or promotional
73+
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74+
member of the public at large and to the detriment of Affirmer's heirs and
75+
successors, fully intending that such Waiver shall not be subject to
76+
revocation, rescission, cancellation, termination, or any other legal or
77+
equitable action to disrupt the quiet enjoyment of the Work by the public
78+
as contemplated by Affirmer's express Statement of Purpose.
79+
80+
3. Public License Fallback. Should any part of the Waiver for any reason
81+
be judged legally invalid or ineffective under applicable law, then the
82+
Waiver shall be preserved to the maximum extent permitted taking into
83+
account Affirmer's express Statement of Purpose. In addition, to the
84+
extent the Waiver is so judged Affirmer hereby grants to each affected
85+
person a royalty-free, non transferable, non sublicensable, non exclusive,
86+
irrevocable and unconditional license to exercise Affirmer's Copyright and
87+
Related Rights in the Work (i) in all territories worldwide, (ii) for the
88+
maximum duration provided by applicable law or treaty (including future
89+
time extensions), (iii) in any current or future medium and for any number
90+
of copies, and (iv) for any purpose whatsoever, including without
91+
limitation commercial, advertising or promotional purposes (the
92+
"License"). The License shall be deemed effective as of the date CC0 was
93+
applied by Affirmer to the Work. Should any part of the License for any
94+
reason be judged legally invalid or ineffective under applicable law, such
95+
partial invalidity or ineffectiveness shall not invalidate the remainder
96+
of the License, and in such case Affirmer hereby affirms that he or she
97+
will not (i) exercise any of his or her remaining Copyright and Related
98+
Rights in the Work or (ii) assert any associated claims and causes of
99+
action with respect to the Work, in either case contrary to Affirmer's
100+
express Statement of Purpose.
101+
102+
4. Limitations and Disclaimers.
103+
104+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
105+
surrendered, licensed or otherwise affected by this document.
106+
b. Affirmer offers the Work as-is and makes no representations or
107+
warranties of any kind concerning the Work, express, implied,
108+
statutory or otherwise, including without limitation warranties of
109+
title, merchantability, fitness for a particular purpose, non
110+
infringement, or the absence of latent or other defects, accuracy, or
111+
the present or absence of errors, whether or not discoverable, all to
112+
the greatest extent permissible under applicable law.
113+
c. Affirmer disclaims responsibility for clearing rights of other persons
114+
that may apply to the Work or any use thereof, including without
115+
limitation any person's Copyright and Related Rights in the Work.
116+
Further, Affirmer disclaims responsibility for obtaining any necessary
117+
consents, permissions or other rights required for any use of the
118+
Work.
119+
d. Affirmer understands and acknowledges that Creative Commons is not a
120+
party to this document and has no duty or obligation with respect to
121+
this CC0 or use of the Work.

0 commit comments

Comments
 (0)