From 64b180881a30f12edc6ea20794fb8bcf6bf3caf0 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 15 Jan 2024 01:59:09 +0100 Subject: [PATCH] chore: Rename service correctly --- .../aidl/app/revanced/library/IRootService.aidl | 5 ----- .../command/ILocalShellCommandRunnerRootService.aidl | 5 +++++ .../installation/command/LocalShellCommandRunner.kt | 7 ++----- .../command/LocalShellCommandRunnerRootService.kt | 3 +-- 4 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 revanced-library/src/androidMain/aidl/app/revanced/library/IRootService.aidl create mode 100644 revanced-library/src/androidMain/aidl/app/revanced/library/installation/command/ILocalShellCommandRunnerRootService.aidl diff --git a/revanced-library/src/androidMain/aidl/app/revanced/library/IRootService.aidl b/revanced-library/src/androidMain/aidl/app/revanced/library/IRootService.aidl deleted file mode 100644 index 09f4f8c..0000000 --- a/revanced-library/src/androidMain/aidl/app/revanced/library/IRootService.aidl +++ /dev/null @@ -1,5 +0,0 @@ -package app.revanced.library; - -interface IRootService { - IBinder getFileSystemService(); -} diff --git a/revanced-library/src/androidMain/aidl/app/revanced/library/installation/command/ILocalShellCommandRunnerRootService.aidl b/revanced-library/src/androidMain/aidl/app/revanced/library/installation/command/ILocalShellCommandRunnerRootService.aidl new file mode 100644 index 0000000..39861ec --- /dev/null +++ b/revanced-library/src/androidMain/aidl/app/revanced/library/installation/command/ILocalShellCommandRunnerRootService.aidl @@ -0,0 +1,5 @@ +package app.revanced.library.installation.command; + +interface ILocalShellCommandRunnerRootService { + IBinder getFileSystemService(); +} diff --git a/revanced-library/src/androidMain/kotlin/app/revanced/library/installation/command/LocalShellCommandRunner.kt b/revanced-library/src/androidMain/kotlin/app/revanced/library/installation/command/LocalShellCommandRunner.kt index 9f65715..9b32395 100644 --- a/revanced-library/src/androidMain/kotlin/app/revanced/library/installation/command/LocalShellCommandRunner.kt +++ b/revanced-library/src/androidMain/kotlin/app/revanced/library/installation/command/LocalShellCommandRunner.kt @@ -5,7 +5,6 @@ import android.content.Context import android.content.Intent import android.content.ServiceConnection import android.os.IBinder -import app.revanced.library.IRootService import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.internal.BuilderImpl import com.topjohnwu.superuser.ipc.RootService @@ -65,10 +64,8 @@ class LocalShellCommandRunner( } override fun onServiceConnected(name: ComponentName?, service: IBinder?) { - val ipc = IRootService.Stub.asInterface(service) - val binder = ipc.fileSystemService - - fileSystemManager = FileSystemManager.getRemote(binder) + val ipc = ILocalShellCommandRunnerRootService.Stub.asInterface(service) + fileSystemManager = FileSystemManager.getRemote(ipc.fileSystemService) logger.info("LocalShellCommandRunner service is ready") diff --git a/revanced-library/src/androidMain/kotlin/app/revanced/library/installation/command/LocalShellCommandRunnerRootService.kt b/revanced-library/src/androidMain/kotlin/app/revanced/library/installation/command/LocalShellCommandRunnerRootService.kt index cc3c976..e221257 100644 --- a/revanced-library/src/androidMain/kotlin/app/revanced/library/installation/command/LocalShellCommandRunnerRootService.kt +++ b/revanced-library/src/androidMain/kotlin/app/revanced/library/installation/command/LocalShellCommandRunnerRootService.kt @@ -1,7 +1,6 @@ package app.revanced.library.installation.command import android.content.Intent -import app.revanced.library.IRootService import com.topjohnwu.superuser.ipc.RootService import com.topjohnwu.superuser.nio.FileSystemManager @@ -9,7 +8,7 @@ import com.topjohnwu.superuser.nio.FileSystemManager * The [RootService] for the [LocalShellCommandRunner]. */ internal class LocalShellCommandRunnerRootService : RootService() { - override fun onBind(intent: Intent) = object : IRootService.Stub() { + override fun onBind(intent: Intent) = object : ILocalShellCommandRunnerRootService.Stub() { override fun getFileSystemService() = FileSystemManager.getService() }