Skip to content

Commit 359d396

Browse files
committed
fix: #388
Change-Id: Idb7492a75cc4e24a77ffa532a8f7afce365f6d11
1 parent ae989e5 commit 359d396

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

source/core/rootservice/src/main/kotlin/com/xayah/core/rootservice/impl/RemoteRootServiceImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import java.nio.file.SimpleFileVisitor
5151
import java.nio.file.attribute.BasicFileAttributes
5252
import kotlin.io.path.pathString
5353

54-
internal class RemoteRootServiceImpl : IRemoteRootService.Stub() {
54+
internal class RemoteRootServiceImpl(private val context: Context) : IRemoteRootService.Stub() {
5555
private val lock = Any()
5656
private var systemContext: Context
5757
private var packageManager: PackageManager
@@ -131,7 +131,7 @@ internal class RemoteRootServiceImpl : IRemoteRootService.Stub() {
131131
val parcel = Parcel.obtain()
132132
parcel.setDataPosition(0)
133133
block(parcel)
134-
val tmpFile = File.createTempFile("databackup-parcel-", ".tmp")
134+
val tmpFile = File.createTempFile("databackup-parcel-", ".tmp", context.cacheDir)
135135
tmpFile.delete()
136136
tmpFile.createNewFile()
137137
tmpFile.writeBytes(parcel.marshall())

source/core/rootservice/src/main/kotlin/com/xayah/core/rootservice/service/RemoteRootService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class RemoteRootService(private val context: Context) {
6464
System.loadLibrary("nativelib")
6565
}
6666

67-
override fun onBind(intent: Intent): IBinder = RemoteRootServiceImpl()
67+
override fun onBind(intent: Intent): IBinder = RemoteRootServiceImpl(applicationContext)
6868
}
6969

7070
private suspend fun bindService(): IRemoteRootService = run {

0 commit comments

Comments
 (0)