Skip to content

Commit

Permalink
更新V12.7.5
Browse files Browse the repository at this point in the history
修复兼容性问题
  • Loading branch information
mingzhixian committed Jul 22, 2023
1 parent 05773f8 commit 2ff5882
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
13 changes: 12 additions & 1 deletion scrcpy_android/.idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scrcpy_android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "top.saymzx.scrcpy.android"
minSdk 23
targetSdk 33
versionCode 1274
versionName "12.7.4"
versionCode 1275
versionName "12.7.5"
resConfigs "zh"
resConfigs "xhdpi"
ndk {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ class SetActivity : Activity() {
private fun setRenewKeyListener() {
setActivity.setRenewKey.setOnClickListener {
AdbKeyPair.generate(appData.privateKey, appData.publicKey)
appData.keyPair = AdbKeyPair.read(appData.privateKey, appData.publicKey)
Toast.makeText(this, "已刷新", Toast.LENGTH_SHORT).show()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,10 @@ class Scrcpy(private val device: Device) {
codec.getInputBuffer(inIndex)!!.put(buffer.third)
// 提交解码器解码
codec.queueInputBuffer(inIndex, 0, buffer.second, buffer.first, 0)
// 连续4个空包检测是否熄屏了
// 连续8个空包检测是否熄屏了
if (buffer.second < 150) {
zeroFrameNum++
if (zeroFrameNum > 4) {
if (zeroFrameNum > 7) {
zeroFrameNum = 0
checkScreenOff()
}
Expand Down Expand Up @@ -598,13 +598,14 @@ class Scrcpy(private val device: Device) {
if (!isScreenOning) {
appData.mainScope.launch {
try {
isScreenOning = true
if (!runAdbCmd("dumpsys deviceidle | grep mScreenOn", true).contains("mScreenOn=true")) {
isScreenOning = true
runAdbCmd("input keyevent 26", false)
delay(1000)
setPowerOff()
isScreenOning = false
delay(1000)
}
isScreenOning = false
} catch (_: Exception) {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import kotlinx.coroutines.MainScope
import top.saymzx.scrcpy.adb.AdbKeyPair
import top.saymzx.scrcpy.android.BuildConfig
import top.saymzx.scrcpy.android.MainActivity
import top.saymzx.scrcpy.android.appData
import top.saymzx.scrcpy.android.entity.Device
import top.saymzx.scrcpy.android.entity.SetValue
import java.io.File
Expand Down Expand Up @@ -126,7 +125,7 @@ class AppData : ViewModel() {
if (!privateKey.isFile || !publicKey.isFile) {
AdbKeyPair.generate(privateKey, publicKey)
}
keyPair = AdbKeyPair.read(appData.privateKey, appData.publicKey)
keyPair = AdbKeyPair.read(privateKey, publicKey)
}

}

0 comments on commit 2ff5882

Please sign in to comment.