Update DeployWithAdbTask.kt

This commit is contained in:
Cloudburst 2022-08-04 16:01:27 +02:00 committed by GitHub
parent 8c144273b3
commit 819b0efaf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 13 deletions

View File

@ -40,27 +40,24 @@ abstract class DeployWithAdbTask : DefaultTask() {
var file = make.outputs.files.singleFile
var path = "/storage/emulated/0/Cloudstream3/plugins/"
device.push(file, RemoteFile(path + file.name))
if (extension.projectType.get() != ProjectType.INJECTOR) {
val args = arrayListOf("start", "-S", "-n", "com.lagradost.cloudstream3.debug/com.lagradost.cloudstream3.MainActivity")
val args = arrayListOf("start", "-S", "-n", "com.lagradost.cloudstream3.debug/com.lagradost.cloudstream3.MainActivity")
if (waitForDebugger) {
args.add("-D")
}
if (waitForDebugger) {
args.add("-D")
}
val response = String(
device.executeShell("am", *args.toTypedArray()).readAllBytes(), StandardCharsets.UTF_8
)
val response = String(
device.executeShell("am", *args.toTypedArray()).readAllBytes(), StandardCharsets.UTF_8
)
if (response.contains("Error")) {
logger.error(response)
}
if (response.contains("Error")) {
logger.error(response)
}
logger.lifecycle("Deployed $file to ${device.serial}")
}
}
}