mirror of
https://github.com/ReVanced/revanced-library.git
synced 2026-01-13 14:43:12 +00:00
Compare commits
1 Commits
fix/adbshe
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0673307204 |
@@ -109,9 +109,9 @@ You can find the contribution guidelines [here](CONTRIBUTING.md).
|
|||||||
To build ReVanced Library,
|
To build ReVanced Library,
|
||||||
you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation).
|
you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation).
|
||||||
|
|
||||||
## 📜 Licence
|
## 📜 License
|
||||||
|
|
||||||
ReVanced Library is licensed under the GPLv3 license. Please see the [licence file](LICENSE) for more information.
|
ReVanced Library is licensed under the GPLv3 license. Please see the [license file](LICENSE) for more information.
|
||||||
[tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3) you may copy, distribute and modify ReVanced Library as long as you track changes/dates in source files.
|
[tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3) you may copy, distribute and modify ReVanced Library as long as you track changes/dates in source files.
|
||||||
Any modifications to ReVanced Library must also be made available under the GPL,
|
Any modifications to ReVanced Library must also be made available under the GPL,
|
||||||
along with build & install instructions.
|
along with build & install instructions.
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class AdbShellCommandRunner : ShellCommandRunner {
|
|||||||
override fun runCommand(command: String) = device.shellProcessBuilder(command).start().let { process ->
|
override fun runCommand(command: String) = device.shellProcessBuilder(command).start().let { process ->
|
||||||
object : RunResult {
|
object : RunResult {
|
||||||
override val exitCode by lazy { process.waitFor() }
|
override val exitCode by lazy { process.waitFor() }
|
||||||
override val output by lazy { process.inputStream.bufferedReader().readText().removeSuffix("\n") }
|
override val output by lazy { process.inputStream.bufferedReader().readText() }
|
||||||
override val error by lazy { process.errorStream.bufferedReader().readText() }
|
override val error by lazy { process.errorStream.bufferedReader().readText() }
|
||||||
|
|
||||||
override fun waitFor() {
|
override fun waitFor() {
|
||||||
@@ -44,7 +44,7 @@ class AdbShellCommandRunner : ShellCommandRunner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hasRootPermission(): Boolean = invoke("su -c whoami").exitCode == 0
|
override fun hasRootPermission(): Boolean = invoke("whoami").exitCode == 0
|
||||||
|
|
||||||
override fun write(content: InputStream, targetFilePath: String) =
|
override fun write(content: InputStream, targetFilePath: String) =
|
||||||
device.push(content, System.currentTimeMillis(), 644, RemoteFile(targetFilePath))
|
device.push(content, System.currentTimeMillis(), 644, RemoteFile(targetFilePath))
|
||||||
|
|||||||
@@ -55,5 +55,5 @@ abstract class ShellCommandRunner internal constructor() {
|
|||||||
*/
|
*/
|
||||||
internal operator fun invoke(
|
internal operator fun invoke(
|
||||||
command: String,
|
command: String,
|
||||||
) = runCommand(command)
|
) = runCommand("su -c \'$command\'")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ abstract class RootInstaller internal constructor(
|
|||||||
/**
|
/**
|
||||||
* Runs a command on the device.
|
* Runs a command on the device.
|
||||||
*/
|
*/
|
||||||
protected operator fun String.invoke() = shellCommandRunner("su -c \'$this\'")
|
protected operator fun String.invoke() = shellCommandRunner(this)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the given file to the given [targetFilePath].
|
* Moves the given file to the given [targetFilePath].
|
||||||
|
|||||||
Reference in New Issue
Block a user