Skip to content

Commit

Permalink
susfs: Add susfs lib
Browse files Browse the repository at this point in the history
  • Loading branch information
changhuapeng committed Dec 23, 2024
1 parent 5d73952 commit 13f631c
Show file tree
Hide file tree
Showing 6 changed files with 862 additions and 5 deletions.
41 changes: 36 additions & 5 deletions .github/workflows/build-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: Build Manager

on:
push:
branches: [ "legacy", "ci", "susfs-*" ]
branches: [ "legacy", "ci", "susfs-*", "libsusfs" ]
paths:
- '.github/workflows/build-manager.yml'
- 'manager/**'
- 'kernel/**'
- 'userspace/ksud/**'
- 'userspace/susfs/**'
pull_request:
branches: [ "legacy" ]
paths:
Expand Down Expand Up @@ -119,8 +120,19 @@ jobs:
os: ${{ matrix.os }}
pack_lkm: false

build-susfs:
needs: update-version
strategy:
matrix:
include:
- target: arm64-v8a
- target: x86_64
uses: ./.github/workflows/susfs.yml
with:
target: ${{ matrix.target }}

build-manager:
needs: build-ksud
needs: [build-ksud, build-susfs]
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -143,7 +155,7 @@ jobs:
fi
- name: Write key
if: ${{ ( github.event_name != 'pull_request' && ( github.ref == 'refs/heads/legacy' || startsWith(github.ref, 'refs/heads/susfs-') )) || github.ref_type == 'tag' }}
if: ${{ ( github.event_name != 'pull_request' && ( github.ref == 'refs/heads/libsusfs' || github.ref == 'refs/heads/legacy' || startsWith(github.ref, 'refs/heads/susfs-') )) || github.ref_type == 'tag' }}
run: |
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
{
Expand Down Expand Up @@ -186,6 +198,25 @@ jobs:
cp -f ../aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud.so
cp -f ../x86_64-linux-android/release/ksud ../manager/app/src/main/jniLibs/x86_64/libksud.so
- name: Download arm64 susfs
uses: actions/download-artifact@v4
with:
name: susfs-arm64-v8a
path: ./arm64-v8a

- name: Download x86_64 susfs
uses: actions/download-artifact@v4
with:
name: susfs-x86_64
path: ./x86_64

- name: Copy susfs to app jniLibs
run: |
mkdir -p app/src/main/jniLibs/arm64-v8a
mkdir -p app/src/main/jniLibs/x86_64
cp -f ../arm64-v8a/susfs ../manager/app/src/main/jniLibs/arm64-v8a/libsusfs.so
cp -f ../x86_64/susfs ../manager/app/src/main/jniLibs/x86_64/libsusfs.so
- name: Build with Gradle
run: |
{
Expand All @@ -199,14 +230,14 @@ jobs:
- name: Upload build artifact
uses: actions/upload-artifact@v4
if: ${{ ( github.event_name != 'pull_request' && ( github.ref == 'refs/heads/legacy' || startsWith(github.ref, 'refs/heads/susfs-') )) || github.ref_type == 'tag' }}
if: ${{ ( github.event_name != 'pull_request' && ( github.ref == 'refs/heads/libsusfs' || github.ref == 'refs/heads/legacy' || startsWith(github.ref, 'refs/heads/susfs-') )) || github.ref_type == 'tag' }}
with:
name: manager
path: manager/app/build/outputs/apk/release/*.apk

- name: Upload mappings
uses: actions/upload-artifact@v4
if: ${{ ( github.event_name != 'pull_request' && ( github.ref == 'refs/heads/legacy' || startsWith(github.ref, 'refs/heads/susfs-') )) || github.ref_type == 'tag' }}
if: ${{ ( github.event_name != 'pull_request' && ( github.ref == 'refs/heads/libsusfs' || github.ref == 'refs/heads/legacy' || startsWith(github.ref, 'refs/heads/susfs-') )) || github.ref_type == 'tag' }}
with:
name: "mappings"
path: "manager/app/build/outputs/mapping/release/"
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/susfs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build susfs
on:
workflow_call:
inputs:
target:
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download artifacts
uses: actions/download-artifact@v4

- name: Build susfs
working-directory: ./userspace/susfs
run: $ANDROID_NDK/ndk-build

- name: Upload susfs artifact
uses: actions/upload-artifact@v4
with:
name: susfs-${{ inputs.target }}
path: ./userspace/susfs/libs/${{ inputs.target }}/susfs
2 changes: 2 additions & 0 deletions userspace/susfs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/obj
/libs
8 changes: 8 additions & 0 deletions userspace/susfs/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := susfs
LOCAL_SRC_FILES := main.c

include $(BUILD_EXECUTABLE)
3 changes: 3 additions & 0 deletions userspace/susfs/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
APP_ABI := arm64-v8a armeabi-v7a x86 x86_64
APP_PLATFORM := android-24
APP_STL := none
Loading

0 comments on commit 13f631c

Please sign in to comment.