diff --git a/.github/workflows/build-manager.yml b/.github/workflows/build-manager.yml index 085bc483..0717884b 100644 --- a/.github/workflows/build-manager.yml +++ b/.github/workflows/build-manager.yml @@ -8,7 +8,7 @@ on: - 'manager/**' - 'kernel/**' - 'userspace/ksud/**' - - 'userspace/susfs/**' + - 'userspace/susfsd/**' pull_request: branches: [ "next" ] paths: @@ -21,8 +21,20 @@ jobs: uses: ./.github/workflows/build-lkm.yml secrets: inherit - build-ksud: + build-susfs: needs: build-lkm + strategy: + matrix: + include: + - target: aarch64-linux-android + os: ubuntu-latest + uses: ./.github/workflows/susfsd.yml + with: + target: ${{ matrix.target }} + os: ${{ matrix.os }} + + build-ksud: + needs: build-susfsd strategy: matrix: include: @@ -33,20 +45,8 @@ jobs: target: ${{ matrix.target }} os: ${{ matrix.os }} - build-susfs: - needs: build-ksud - strategy: - matrix: - include: - - target: aarch64-linux-android - os: ubuntu-latest - uses: ./.github/workflows/build-susfs.yml - with: - target: ${{ matrix.target }} - os: ${{ matrix.os }} - build-manager: - needs: build-susfs + needs: build-ksud runs-on: ubuntu-latest defaults: run: @@ -82,26 +82,26 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v3 - - name: Download arm64 ksud - uses: actions/download-artifact@v4 - with: - name: ksud-aarch64-linux-android - path: . - - name: Download arm64 susfs uses: actions/download-artifact@v4 with: name: susfs-aarch64-linux-android path: . - - name: Copy ksud to app jniLibs + - name: Download arm64 ksud + uses: actions/download-artifact@v4 + with: + name: ksud-aarch64-linux-android + path: . + + - name: Copy susfsd to app jniLibs run: | mkdir -p app/src/main/jniLibs/arm64-v8a - cp -f ../aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud.so + cp -f ../arm64-v8a/susfsd ../manager/app/src/main/jniLibs/arm64-v8a/libsusfsd.so - - name: Copy susfs to app jniLibs + - name: Copy ksud to app jniLibs run: | - cp -f ../arm64-v8a/susfs ../manager/app/src/main/jniLibs/arm64-v8a/libsusfs.so + cp -f ../aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud.so - name: Build with Gradle run: | diff --git a/.github/workflows/ksud.yml b/.github/workflows/ksud.yml index 5e74bb17..77b9841d 100644 --- a/.github/workflows/ksud.yml +++ b/.github/workflows/ksud.yml @@ -32,6 +32,10 @@ jobs: if: ${{ inputs.pack_lkm }} run: | cp android*-lkm/*_kernelsu.ko ./userspace/ksud/bin/aarch64/ + + - name: Add susfsd lib + run: | + cp susfsd-aarch64-linux-android/arm64-v8a/susfsd ./userspace/ksud/bin/aarch64/ - name: Setup rustup run: | diff --git a/.github/workflows/build-susfs.yml b/.github/workflows/susfsd.yml similarity index 78% rename from .github/workflows/build-susfs.yml rename to .github/workflows/susfsd.yml index 056dbeee..90086594 100644 --- a/.github/workflows/build-susfs.yml +++ b/.github/workflows/susfsd.yml @@ -3,8 +3,8 @@ on: push: branches: [ "next" ] paths: - - '.github/workflows/build-susfs.yml' - - 'userspace/susfs/**' + - '.github/workflows/susfsd.yml' + - 'userspace/susfsd/**' workflow_dispatch: workflow_call: inputs: @@ -17,18 +17,18 @@ on: default: ubuntu-latest jobs: build-susfs: - name: Build userspace susfs + name: Build userspace susfsd runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Build susfs + - name: Build susfsd working-directory: ./userspace/susfs run: $ANDROID_NDK/ndk-build - name: Upload a Build Artifact uses: actions/upload-artifact@v4 with: name: susfs-aarch64-linux-android - path: ./userspace/susfs/libs + path: ./userspace/susfsd/libs diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/MainActivity.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/MainActivity.kt index ac82699a..9808f45d 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/MainActivity.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/MainActivity.kt @@ -69,16 +69,16 @@ class MainActivity : ComponentActivity() { val isManager = Natives.becomeManager(ksuApp.packageName) if (isManager) install() - val prefs = getSharedPreferences("settings", MODE_PRIVATE) + // val prefs = getSharedPreferences("settings", MODE_PRIVATE) - val isSUS_SU = getSuSFSFeatures() - if (isSUS_SU == "CONFIG_KSU_SUSFS_SUS_SU") { - if (prefs.getBoolean("enable_sus_su", false)) { - if (susfsSUS_SU_Mode() != "2") { - susfsSUS_SU_2() - } - } - } + // val isSUS_SU = getSuSFSFeatures() + // if (isSUS_SU == "CONFIG_KSU_SUSFS_SUS_SU") { + // if (prefs.getBoolean("enable_sus_su", false)) { + // if (susfsSUS_SU_Mode() != "2") { + // susfsSUS_SU_2() + // } + // } + // } setContent { KernelSUTheme { diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/util/KsuCli.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/util/KsuCli.kt index dbbcc22d..78ca4003 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/util/KsuCli.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/util/KsuCli.kt @@ -120,48 +120,48 @@ fun getModuleCount(): Int { }.getOrElse { return 0 } } -private fun getSuSFSPath(): String { - return ksuApp.applicationInfo.nativeLibraryDir + File.separator + "libsusfs.so" +private fun getSuSFSDaemonPath(): String { + return ksuApp.applicationInfo.nativeLibraryDir + File.separator + "libsusfsd.so" } fun getSuSFS(): String { val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSPath()} support") + val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} support") return result } fun getSuSFSVersion(): String { val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSPath()} version") + val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} version") return result } fun getSuSFSVariant(): String { val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSPath()} variant") + val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} variant") return result } fun getSuSFSFeatures(): String { val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSPath()} features") + val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} features") return result } fun susfsSUS_SU_0(): String { val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSPath()} sus_su 0") + val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} sus_su 0") return result } fun susfsSUS_SU_2(): String { val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSPath()} sus_su 2") + val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} sus_su 2") return result } fun susfsSUS_SU_Mode(): String { val shell = getRootShell() - val result = ShellUtils.fastCmd(shell, "${getSuSFSPath()} sus_su mode") + val result = ShellUtils.fastCmd(shell, "${getSuSFSDaemonPath()} sus_su mode") return result } diff --git a/manager/app/src/main/jniLibs/arm64-v8a/libsusfs.so b/manager/app/src/main/jniLibs/arm64-v8a/libsusfsd.so similarity index 100% rename from manager/app/src/main/jniLibs/arm64-v8a/libsusfs.so rename to manager/app/src/main/jniLibs/arm64-v8a/libsusfsd.so diff --git a/userspace/ksud/bin/aarch64/susfsd b/userspace/ksud/bin/aarch64/susfsd new file mode 100755 index 00000000..13c131f9 Binary files /dev/null and b/userspace/ksud/bin/aarch64/susfsd differ diff --git a/userspace/ksud/bin/x86_64/busybox b/userspace/ksud/bin/x86_64/busybox deleted file mode 100755 index 2557c61d..00000000 Binary files a/userspace/ksud/bin/x86_64/busybox and /dev/null differ diff --git a/userspace/ksud/bin/x86_64/ksuinit b/userspace/ksud/bin/x86_64/ksuinit deleted file mode 100755 index 9517baf9..00000000 Binary files a/userspace/ksud/bin/x86_64/ksuinit and /dev/null differ diff --git a/userspace/ksud/bin/x86_64/resetprop b/userspace/ksud/bin/x86_64/resetprop deleted file mode 100644 index 80030612..00000000 Binary files a/userspace/ksud/bin/x86_64/resetprop and /dev/null differ diff --git a/userspace/ksud/src/assets.rs b/userspace/ksud/src/assets.rs index e8255c82..f7623bbe 100644 --- a/userspace/ksud/src/assets.rs +++ b/userspace/ksud/src/assets.rs @@ -8,6 +8,7 @@ use crate::{defs::BINARY_DIR, utils}; pub const RESETPROP_PATH: &str = concatcp!(BINARY_DIR, "resetprop"); pub const BUSYBOX_PATH: &str = concatcp!(BINARY_DIR, "busybox"); pub const BOOTCTL_PATH: &str = concatcp!(BINARY_DIR, "bootctl"); +pub const SUSFSD_PATH: &str = concatcp!(BINARY_DIR, "susfsd"); #[cfg(all(target_arch = "x86_64", target_os = "android"))] #[derive(RustEmbed)] diff --git a/userspace/susfs/jni/Android.mk b/userspace/susfs/jni/Android.mk index cab15322..e805f0b4 100644 --- a/userspace/susfs/jni/Android.mk +++ b/userspace/susfs/jni/Android.mk @@ -1,6 +1,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := susfs -LOCAL_SRC_FILES := susfs.c +LOCAL_MODULE := susfsd +LOCAL_SRC_FILES := susfsd.c include $(BUILD_EXECUTABLE) diff --git a/userspace/susfs/jni/susfs.c b/userspace/susfs/jni/susfsd.c similarity index 100% rename from userspace/susfs/jni/susfs.c rename to userspace/susfs/jni/susfsd.c