Fix deprecations

This commit is contained in:
Mygod
2020-08-18 05:02:09 +08:00
parent 8a1df227c1
commit 35055bc074
10 changed files with 33 additions and 34 deletions

View File

@@ -81,7 +81,7 @@ object AppProcess {
val script = StringBuilder()
val (baseDir, relocated) = if (Build.VERSION.SDK_INT < 29) "/dev" to "/dev/app_process_$token" else {
val apexPath = "/apex/$token"
script.appendln("[ -d $apexPath ] || " +
script.appendLine("[ -d $apexPath ] || " +
"mkdir $apexPath && " +
// we need to mount a new tmpfs to override noexec flag
"mount -t tmpfs -o size=1M tmpfs $apexPath || exit 1")
@@ -95,13 +95,13 @@ object AppProcess {
Logger.me.w("Failed to locate system section", e)
"system"
}
script.appendln("[ -f $ldConfig ] || " +
script.appendLine("[ -f $ldConfig ] || " +
"mkdir -p $apexPath/etc && " +
"echo dir.$section = $apexPath >$ldConfig && " +
"cat $masterLdConfig >>$ldConfig || exit 1")
"$apexPath/bin" to "$apexPath/bin/app_process"
}
script.appendln("[ -f $relocated ] || " +
script.appendLine("[ -f $relocated ] || " +
"mkdir -p $baseDir && " +
"cp $myExe $relocated && " +
"chmod 700 $relocated || exit 1")

View File

@@ -152,7 +152,7 @@ class RootServer {
UUID.randomUUID().toString().also { persistence.writeText(it) }
}
val (script, relocated) = AppProcess.relocateScript(uuid)
script.appendln(AppProcess.launchString(context.packageCodePath, RootServer::class.java.name, relocated,
script.appendLine(AppProcess.launchString(context.packageCodePath, RootServer::class.java.name, relocated,
niceName) + " $token2")
writer.writeBytes(script.toString())
writer.flush()
@@ -409,7 +409,7 @@ class RootServer {
Os.dup2(FileDescriptor.err, OsConstants.STDOUT_FILENO)
System.setOut(System.err)
val writer = writer()
writer.appendln(args[0]) // echo ready signal
writer.appendLine(args[0]) // echo ready signal
writer.flush()
})
// thread safety: usage of input should be in main thread