File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
source/core/rootservice/src/main/kotlin/com/xayah/core/rootservice Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ import java.nio.file.SimpleFileVisitor
51
51
import java.nio.file.attribute.BasicFileAttributes
52
52
import kotlin.io.path.pathString
53
53
54
- internal class RemoteRootServiceImpl : IRemoteRootService .Stub () {
54
+ internal class RemoteRootServiceImpl ( private val context : Context ) : IRemoteRootService.Stub() {
55
55
private val lock = Any ()
56
56
private var systemContext: Context
57
57
private var packageManager: PackageManager
@@ -131,7 +131,7 @@ internal class RemoteRootServiceImpl : IRemoteRootService.Stub() {
131
131
val parcel = Parcel .obtain()
132
132
parcel.setDataPosition(0 )
133
133
block(parcel)
134
- val tmpFile = File .createTempFile(" databackup-parcel-" , " .tmp" )
134
+ val tmpFile = File .createTempFile(" databackup-parcel-" , " .tmp" , context.cacheDir )
135
135
tmpFile.delete()
136
136
tmpFile.createNewFile()
137
137
tmpFile.writeBytes(parcel.marshall())
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class RemoteRootService(private val context: Context) {
64
64
System .loadLibrary(" nativelib" )
65
65
}
66
66
67
- override fun onBind (intent : Intent ): IBinder = RemoteRootServiceImpl ()
67
+ override fun onBind (intent : Intent ): IBinder = RemoteRootServiceImpl (applicationContext )
68
68
}
69
69
70
70
private suspend fun bindService (): IRemoteRootService = run {
You can’t perform that action at this time.
0 commit comments