You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
作者大大能否在打包时对打包的程序代码进行增加授权功能?autojs您已经添加了“投影媒体权限”,但是打包后不能直接授权这个权限,只能每次截图时点击确认授权,能否也把这些改为可自定义添加:
val mediaProjectionManager = getSystemService(Context.MEDIA_PROJECTION_SERVICE) as MediaProjectionManager
val intent = mediaProjectionManager.createScreenCaptureIntent()
startActivityForResult(intent, REQUEST_CODE_CAPTURE_PERM)
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE_CAPTURE_PERM) {
if (resultCode == RESULT_OK) {
// 用户授予了权限,可以继续处理MediaProjection
val mediaProjection = mediaProjectionManager.getMediaProjection(resultCode, data)
// 使用mediaProjection进行后续操作
} else {
// 用户拒绝了权限,处理拒绝情况
}
}
}
The text was updated successfully, but these errors were encountered:
作者大大能否在打包时对打包的程序代码进行增加授权功能?autojs您已经添加了“投影媒体权限”,但是打包后不能直接授权这个权限,只能每次截图时点击确认授权,能否也把这些改为可自定义添加:
val mediaProjectionManager = getSystemService(Context.MEDIA_PROJECTION_SERVICE) as MediaProjectionManager
val intent = mediaProjectionManager.createScreenCaptureIntent()
startActivityForResult(intent, REQUEST_CODE_CAPTURE_PERM)
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE_CAPTURE_PERM) {
if (resultCode == RESULT_OK) {
// 用户授予了权限,可以继续处理MediaProjection
val mediaProjection = mediaProjectionManager.getMediaProjection(resultCode, data)
// 使用mediaProjection进行后续操作
} else {
// 用户拒绝了权限,处理拒绝情况
}
}
}
The text was updated successfully, but these errors were encountered: