fix android release can't find method

This commit is contained in:
csf 2022-04-05 17:15:48 +08:00
parent 86c6f9446d
commit c939b3c7bd
2 changed files with 7 additions and 2 deletions

View File

@ -16,7 +16,6 @@
android:label="RustDesk"
android:requestLegacyExternalStorage="true">
<!-- 暂时不开启接收开机广播的功能 enabled设置为false-->
<receiver
android:name=".BootReceiver"
android:enabled="false"
@ -71,4 +70,4 @@
android:value="2" />
</application>
</manifest>
</manifest>

View File

@ -24,6 +24,7 @@ import android.os.*
import android.util.Log
import android.view.Surface
import android.view.Surface.FRAME_RATE_COMPATIBILITY_DEFAULT
import androidx.annotation.Keep
import androidx.annotation.RequiresApi
import androidx.core.app.ActivityCompat
import androidx.core.app.NotificationCompat
@ -65,6 +66,7 @@ class MainService : Service() {
}
// rust call jvm
@Keep
fun rustGetVideoRaw(): ByteArray {
return if (videoData != null) {
videoData!!
@ -73,6 +75,7 @@ class MainService : Service() {
}
}
@Keep
fun rustGetAudioRaw(): FloatArray {
return if (isNewData && audioData != null) {
isNewData = false
@ -82,12 +85,14 @@ class MainService : Service() {
}
}
@Keep
fun rustGetAudioRawLen(): Int {
return if (isNewData && audioData != null && audioData!!.isNotEmpty()) {
audioData!!.size
} else 0
}
@Keep
fun rustGetByName(name: String): String {
return when (name) {
"screen_size" -> "${INFO.screenWidth}:${INFO.screenHeight}"
@ -95,6 +100,7 @@ class MainService : Service() {
}
}
@Keep
fun rustSetByName(name: String, arg1: String, arg2: String) {
when (name) {
"try_start_without_auth" -> {