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

View file

@ -40,25 +40,22 @@ abstract class DeployWithAdbTask : DefaultTask() {
var file = make.outputs.files.singleFile var file = make.outputs.files.singleFile
var path = "/storage/emulated/0/Cloudstream3/plugins/" var path = "/storage/emulated/0/Cloudstream3/plugins/"
device.push(file, RemoteFile(path + file.name)) 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) { if (waitForDebugger) {
args.add("-D") args.add("-D")
} }
val response = String( val response = String(
device.executeShell("am", *args.toTypedArray()).readAllBytes(), StandardCharsets.UTF_8 device.executeShell("am", *args.toTypedArray()).readAllBytes(), StandardCharsets.UTF_8
) )
if (response.contains("Error")) { if (response.contains("Error")) {
logger.error(response) logger.error(response)
}
} }
logger.lifecycle("Deployed $file to ${device.serial}") logger.lifecycle("Deployed $file to ${device.serial}")