mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-16 07:19:52 +00:00
up
This commit is contained in:
parent
8cdcf4138b
commit
760b507286
4 changed files with 24 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
package com.soug.mm.base.config
|
package com.soug.mm.base.config
|
||||||
|
|
||||||
object PortConfig {
|
object PortConfig {
|
||||||
const val HTTP_PORT = 30818
|
const val HTTP_PORT = 30018
|
||||||
}
|
}
|
18
justfile
18
justfile
|
@ -1,5 +1,23 @@
|
||||||
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
|
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
|
||||||
|
|
||||||
|
start_server: push-server close-server-if-need
|
||||||
|
adb shell "nohup sh -c 'CLASSPATH=/data/local/tmp/souls app_process / com.genymobile.scrcpy.Server 3.3.1' > /data/local/tmp/souls.log 2>&1 &"
|
||||||
|
|
||||||
push-server:
|
push-server:
|
||||||
./gradlew assembleRelease
|
./gradlew assembleRelease
|
||||||
adb push ./server/build/outputs/apk/release/server-release-unsigned.apk /data/local/tmp/souls
|
adb push ./server/build/outputs/apk/release/server-release-unsigned.apk /data/local/tmp/souls
|
||||||
|
|
||||||
|
close-server-if-need:
|
||||||
|
#netstat: /proc/kshrink_lruvecd_status: Permission denied
|
||||||
|
#netstat: /proc/voocphy_batt_fake_temp: Permission denied
|
||||||
|
#tcp6 0 0 [::]:30018 [::]:* LISTEN 28394/app_process
|
||||||
|
#tcp6 0 0 ::1:44134 ::1:30018 TIME_WAIT -
|
||||||
|
#tcp6 0 0 ::1:39992 ::1:30018 TIME_WAIT -
|
||||||
|
#OP5A15L1:/data/local/tmp $ netstat -tulpn | grep 30018
|
||||||
|
adb shell "for pid_path in /proc/[0-9]*; do \
|
||||||
|
pid=$${pid_path#/proc/}; \
|
||||||
|
if grep -q ':7572' /proc/$$pid/net/tcp 2>/dev/null; then \
|
||||||
|
kill -9 $$pid; \
|
||||||
|
echo killed $$pid; \
|
||||||
|
fi; \
|
||||||
|
done"
|
||||||
|
|
|
@ -39,6 +39,7 @@ android {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
//noinspection GradleDependencyleVersion
|
//noinspection GradleDependencyleVersion
|
||||||
|
implementation(project(":base"))
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:2.1.21"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:2.1.21"
|
||||||
implementation("io.ktor:ktor-server-netty:3.2.0")
|
implementation("io.ktor:ktor-server-netty:3.2.0")
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ import com.genymobile.scrcpy.video.ScreenCapture
|
||||||
import com.genymobile.scrcpy.video.SurfaceCapture
|
import com.genymobile.scrcpy.video.SurfaceCapture
|
||||||
import com.genymobile.scrcpy.video.SurfaceEncoder
|
import com.genymobile.scrcpy.video.SurfaceEncoder
|
||||||
import com.genymobile.scrcpy.video.VideoSource
|
import com.genymobile.scrcpy.video.VideoSource
|
||||||
|
import com.soug.mm.base.config.PortConfig
|
||||||
import io.ktor.http.ContentType
|
import io.ktor.http.ContentType
|
||||||
import io.ktor.server.engine.embeddedServer
|
import io.ktor.server.engine.embeddedServer
|
||||||
import io.ktor.server.netty.Netty
|
import io.ktor.server.netty.Netty
|
||||||
|
@ -49,10 +50,10 @@ object Server {
|
||||||
* 开启http server
|
* 开启http server
|
||||||
*/
|
*/
|
||||||
private fun startHttpServer() {
|
private fun startHttpServer() {
|
||||||
embeddedServer(Netty, 8080) {
|
embeddedServer(Netty, PortConfig.HTTP_PORT) {
|
||||||
routing {
|
routing {
|
||||||
get("/") {
|
get("/") {
|
||||||
call.respondText("Hello, world!", ContentType.Text.Html)
|
call.respondText("Hello, world!1", ContentType.Text.Html)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start(wait = true)
|
}.start(wait = true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue