Android 11 添加Service服务SELinux问题

简介: Android 11 添加Service服务SELinux问题
 SELinux : avc:  denied  { add } for pid=1018 uid=1000 name=dmtseic scontext=u:r:system_server:s0 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=0
 System  : ******************************************
 System  : ************ Failure starting core service
 System  : ******************************************
 System  : ************ Failure starting system services
 System  : java.lang.SecurityException: 
 System  :  at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
 System  :  at android.os.Parcel.createException(Parcel.java:2357)
 System  :  at android.os.Parcel.readException(Parcel.java:2340)
 System  :  at android.os.Parcel.readException(Parcel.java:2282)
 System  :  at android.os.IServiceManager$Stub$Proxy.addService(IServiceManager.java:380)
 System  :  at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:72)
 System  :  at android.os.ServiceManager.addService(ServiceManager.java:197)
 System  :  at android.os.ServiceManager.addService(ServiceManager.java:166)
 System  :  at com.android.server.SystemServer.startOtherServices(SystemServer.java:1175)
 System  :  at com.android.server.SystemServer.run(SystemServer.java:623)
 System  :  at com.android.server.SystemServer.main(SystemServer.java:429)
 System  :  at java.lang.reflect.Method.invoke(Native Method)
 System  :  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
 System  :  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
问题1:
FAILED: build out/target/product/projectName/obj/FAKE/treble_sepolicy_tests_26.0_intermediates/treble_sepolicy_tests_26.0
Outputs: out/target/product/projectName/obj/FAKE/treble_sepolicy_tests_26.0_intermediates/treble_sepolicy_tests_26.0
Error: exited with code: 1
Command: /bin/bash -c "(out/host/linux-x86/bin/treble_sepolicy_tests -l     out/host/linux-x86/lib64/libsepolwrap.so  -f out/target/product/projectName/system/etc/selinux/plat_file_contexts  -f out/target/product/projectName/vendor/etc/selinux/vendor_file_contexts  -f out/target/product/projectName/system/system_ext/etc/selinux/system_ext_file_contexts    -b out/target/product/projectName/obj/ETC/built_plat_sepolicy_intermediates/built_plat_sepolicy -m out/target/product/projectName/obj/FAKE/treble_sepolicy_tests_26.0_intermediates/26.0_mapping.combined.cil     -o out/target/product/projectName/obj/FAKE/treble_sepolicy_tests_26.0_intermediates/built_26.0_plat_sepolicy -p out/target/product/projectName/obj/ETC/sepolicy_intermediates/sepolicy    -u out/target/product/projectName/obj/ETC/built_plat_sepolicy_intermediates/base_plat_pub_policy.cil ) && (touch out/target/product/projectName/obj/FAKE/treble_sepolicy_tests_26.0_intermediates/treble_sepolicy_tests_26.0 )"
Output:
SELinux: The following public types were found added to the policy without an entry into the compatibility mapping file(s) found in private/compat/V.v/V.v[.ignore].cil, where V.v is the latest API level.
external_dmtseic_service hal_dmtseic_service
 
问题2:
FAILED: build out/target/product/projectName/obj/FAKE/sepolicy_freeze_test_intermediates/sepolicy_freeze_test
Outputs: out/target/product/projectName/obj/FAKE/sepolicy_freeze_test_intermediates/sepolicy_freeze_test
Error: exited with code: 1
Command: /bin/bash -c "(diff -rq -x bug_map system/sepolicy/prebuilts/api/30.0/public system/sepolicy/public ) && (diff -rq -x bug_map system/sepolicy/prebuilts/api/30.0/private system/sepolicy/private ) && (touch out/target/product/projectName/obj/FAKE/sepolicy_freeze_test_intermediates/sepolicy_freeze_test )"
Output:
文件 system/sepolicy/prebuilts/api/30.0/public/service.te 和 system/sepolicy/public/service.te 不同
 
问题3:
FAILED: build out/target/product/projectName/obj/FAKE/treble_sepolicy_tests_26.0_intermediates/26.0_compat
Outputs: out/target/product/projectName/obj/FAKE/treble_sepolicy_tests_26.0_intermediates/26.0_compat
Error: exited with code: 1
Command: /bin/bash -c "out/host/linux-x86/bin/secilc -m -M true -G -N -c 30     out/target/product/projectName/obj/ETC/plat_sepolicy.cil_intermediates/plat_sepolicy.cil out/target/product/projectName/obj/ETC/plat_26.0.cil_intermediates/plat_26.0.cil system/sepolicy/prebuilts/api/26.0/nonplat_sepolicy.cil -o out/target/product/projectName/obj/FAKE/treble_sepolicy_tests_26.0_intermediates/26.0_compat -f /dev/null"
Output:
Failed to resolve typeattributeset statement at out/target/product/projectName/obj/ETC/plat_26.0.cil_intermediates/plat_26.0.cil:187
Failed to compile cildb: -2
  修改:         system/sepolicy/prebuilts/api/26.0/nonplat_sepolicy.cil
  修改:         system/sepolicy/prebuilts/api/26.0/private/service_contexts
  修改:         system/sepolicy/prebuilts/api/26.0/public/service.te
  修改:         system/sepolicy/prebuilts/api/27.0/nonplat_sepolicy.cil
  新文件:       system/sepolicy/prebuilts/api/27.0/private/.service_contexts.swp
  修改:         system/sepolicy/prebuilts/api/27.0/private/compat/26.0/26.0.cil
  修改:         system/sepolicy/prebuilts/api/27.0/private/service_contexts
  修改:         system/sepolicy/prebuilts/api/27.0/public/service.te
  修改:         system/sepolicy/prebuilts/api/28.0/plat_pub_versioned.cil
  修改:         system/sepolicy/prebuilts/api/28.0/private/compat/26.0/26.0.cil
  修改:         system/sepolicy/prebuilts/api/28.0/private/compat/27.0/27.0.cil
  修改:         system/sepolicy/prebuilts/api/28.0/private/service_contexts
  修改:         system/sepolicy/prebuilts/api/28.0/public/service.te
  修改:         system/sepolicy/prebuilts/api/29.0/plat_pub_versioned.cil
  修改:         system/sepolicy/prebuilts/api/29.0/private/compat/26.0/26.0.cil
  修改:         system/sepolicy/prebuilts/api/29.0/private/compat/27.0/27.0.cil
  修改:         system/sepolicy/prebuilts/api/29.0/private/compat/28.0/28.0.cil
  修改:         system/sepolicy/prebuilts/api/29.0/private/compat/28.0/28.0.ignore.cil
  修改:         system/sepolicy/prebuilts/api/29.0/private/service_contexts
  修改:         system/sepolicy/prebuilts/api/29.0/public/service.te
  修改:         system/sepolicy/prebuilts/api/30.0/private/compat/26.0/26.0.cil
  修改:         system/sepolicy/prebuilts/api/30.0/private/compat/27.0/27.0.cil
  修改:         system/sepolicy/prebuilts/api/30.0/private/compat/28.0/28.0.cil
  修改:         system/sepolicy/prebuilts/api/30.0/private/compat/28.0/28.0.ignore.cil
  修改:         system/sepolicy/prebuilts/api/30.0/private/compat/29.0/29.0.cil
  修改:         system/sepolicy/prebuilts/api/30.0/private/service_contexts
  修改:         system/sepolicy/prebuilts/api/30.0/public/service.te
  修改:         system/sepolicy/private/compat/26.0/26.0.cil
  修改:         system/sepolicy/private/compat/27.0/27.0.cil
  修改:         system/sepolicy/private/compat/28.0/28.0.cil
  修改:         system/sepolicy/private/compat/28.0/28.0.ignore.cil
  修改:         system/sepolicy/private/compat/29.0/29.0.cil
  修改:         system/sepolicy/private/service_contexts
  修改:         system/sepolicy/public/service.te
相关文章
|
2月前
|
安全 Java 网络安全
Android远程连接和登录FTPS服务代码(commons.net库)
Android远程连接和登录FTPS服务代码(commons.net库)
26 1
|
3月前
|
JavaScript 前端开发 Android开发
让Vite+Vue3项目在Android端离线打开(不需要起服务)
让Vite+Vue3项目在Android端离线打开(不需要起服务)
102 10
|
3月前
|
调度 Android开发 UED
Android经典实战之Android 14前台服务适配
本文介绍了在Android 14中适配前台服务的关键步骤与最佳实践,包括指定服务类型、请求权限、优化用户体验及使用WorkManager等。通过遵循这些指南,确保应用在新系统上顺畅运行并提升用户体验。
224 6
|
3月前
|
安全 API 开发工具
Android平台RTMP推送|轻量级RTSP服务如何实现麦克风|扬声器声音采集切换
Android平台扬声器播放声音的采集,在无纸化同屏等场景下,意义很大,早期低版本的Android设备,是没法直接采集扬声器audio的(从Android 10开始支持),所以,如果需要采集扬声器audio,需要先做系统版本判断,添加相应的权限。
|
3月前
|
编解码 开发工具 Android开发
Android平台实现屏幕录制(屏幕投影)|音频播放采集|麦克风采集并推送RTMP或轻量级RTSP服务
Android平台屏幕采集、音频播放声音采集、麦克风采集编码打包推送到RTMP和轻量级RTSP服务的相关技术实现,做成高稳定低延迟的同屏系统,还需要有配套好的RTMP、RTSP直播播放器
|
4月前
|
数据处理 开发工具 数据安全/隐私保护
Android平台RTMP推送|轻量级RTSP服务|GB28181接入之文字、png图片水印的精进之路
本文探讨了Android平台上推流模块中添加文字与PNG水印的技术演进。自2015年起,为了满足应急指挥及安防领域的需求,逐步发展出三代水印技术:第一代为静态文字与图像水印;第二代实现了动态更新水印内容的能力,例如实时位置与时间信息;至第三代,则优化了数据传输效率,直接使用Bitmap对象传递水印数据至JNI层,减少了内存拷贝次数。这些迭代不仅提升了用户体验和技术效率,也体现了开发者追求极致与不断创新的精神。
|
4月前
|
数据采集 编解码 开发工具
Android平台实现无纸化同屏并推送RTMP或轻量级RTSP服务(毫秒级延迟)
一个好的无纸化同屏系统,需要考虑的有整体组网、分辨率、码率、实时延迟、音视频同步和连续性等各个指标,做容易,做好难
|
4月前
|
监控 开发工具 Android开发
Android平台实现RTSP拉流转发至轻量级RTSP服务
为满足Android平台上从外部RTSP摄像头拉流并提供轻量级RTSP服务的需求,利用大牛直播SDK实现了相关功能。SDK支持开始与停止拉流、音频视频数据回调处理及RTSP服务的启动与发布等操作。拉流仅需将未解码数据回调,对性能影响小。音频和视频数据经由特定接口传递给发布端进行处理。此外,SDK还提供了获取RTSP会话数量的功能。此方案适用于监控和巡检等低延迟应用场景,并支持二次水印添加等功能。
|
4月前
|
编解码 安全 Ubuntu
Android Selinux 问题处理笔记
这篇文章是关于处理Android系统中SELinux权限问题的笔记,介绍了如何通过分析SELinux拒绝的日志、修改SELinux策略文件,并重新编译部署来解决权限问题,同时提供了一些SELinux的背景知识和实用工具。
92 0
|
4月前
|
编解码 API 开发工具
Android平台轻量级RTSP服务模块二次封装版调用说明
本文介绍了Android平台上轻量级RTSP服务模块的二次封装实践,旨在简化开发流程,让开发者能更专注于业务逻辑。通过`LibPublisherWrapper`类提供的API,可在应用中轻松初始化RTSP服务、配置视频参数(如分辨率、编码类型)、启动与停止RTSP服务及流发布,并获取RTSP会话数量。此外,还展示了如何处理音频和视频数据的采集与推送。最后,文章提供了从启动服务到销毁资源的完整示例,帮助开发者快速集成实时流媒体功能。