Add UID scanner functionality and related infrastructure

- Introduced a new module `uid_scanner` in userspace for managing UID scanning.
- Created a new GitHub Actions workflow for building the `user_scanner`.
- Implemented kernel communication in `throne_comm.c` and `throne_comm.h` to handle user space updates and rescan requests.
- Developed the `uid_scanner` daemon in C to scan user directories and manage UID whitelists.
- Added configuration management for the UID scanner with support for multiple users and auto-scanning.
- Implemented logging and error handling throughout the UID scanning process.
- Created necessary build files for the `user_scanner` JNI integration.
- Added a `.gitignore` file to exclude build artifacts.
This commit is contained in:
ShirkNeko
2025-09-19 21:01:01 +08:00
parent 695e749e3e
commit cc1c66bb6f
21 changed files with 1565 additions and 179 deletions

View File

@@ -10,6 +10,7 @@ on:
- 'userspace/ksud/**'
- 'userspace/susfs/**'
- 'userspace/kpmmgr/**'
- 'userspace/user_scanner/**'
pull_request:
branches: [ "main" ]
paths:
@@ -109,6 +110,19 @@ jobs:
target: ${{ matrix.target }}
os: ${{ matrix.os }}
build-user_scanner:
if: ${{ always() }}
needs: [ check-build-lkm, build-lkm ]
strategy:
matrix:
include:
- target: All-linux-android
os: ubuntu-latest
uses: ./.github/workflows/user_scanner.yml
with:
target: ${{ matrix.target }}
os: ${{ matrix.os }}
build-ksud:
if: ${{ always() }}
needs: [ check-build-lkm, build-lkm ]
@@ -176,6 +190,12 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Download all userscanner artifacts
uses: actions/download-artifact@v4
with:
name: userscanner-all-linux-android
path: .
- name: Download arm64 susfs
uses: actions/download-artifact@v4
with:
@@ -225,6 +245,15 @@ jobs:
mkdir -p app/src/main/jniLibs/arm64-v8a
cp -f ../arm64-v8a/zakozakozako ../manager/app/src/main/jniLibs/arm64-v8a/libzakozakozako.so
- name: Copy user_scanner to app jniLibs
run: |
mkdir -p app/src/main/jniLibs/arm64-v8a
mkdir -p app/src/main/jniLibs/x86_64
mkdir -p app/src/main/jniLibs/armeabi-v7a
cp -f ../arm64-v8a/uid_scanner ../manager/app/src/main/jniLibs/arm64-v8a/uid_scanner.so
cp -f ../x86_64/uid_scanner ../manager/app/src/main/jniLibs/x86_64/uid_scanner.so
cp -f ../armeabi-v7a/uid_scanner ../manager/app/src/main/jniLibs/armeabi-v7a/uid_scanner.so
- name: Build with Gradle
run: ./gradlew clean assembleRelease

40
.github/workflows/user_scanner.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Build user_scanner
on:
push:
branches: [ "mian" ]
paths:
- '.github/workflows/user_scanner.yml'
- 'userspace/user_scanner/**'
workflow_dispatch:
workflow_call:
inputs:
target:
required: true
type: string
os:
required: false
type: string
default: self-hosted
jobs:
build-user_scanner:
name: Build userspace user_scanner
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build user_scanner
working-directory: ./userspace/user_scanner
run: |
$ANDROID_NDK_HOME/ndk-build
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: userscanner-all-linux-android
path: ./userspace/user_scanner/libs