开发过程中遇到Selinux问题分析

java 复制代码
2021-11-20 12:33:01.974 308-308/? E/SELinux: avc:  denied  { add } 
for pid=16582 uid=1000 name=event_usagestats scontext=u:r:system_app:s0 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=0

2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err: java.lang.reflect.InvocationTargetException
2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err:     at com.meizu.dataservice.DataServiceApplication.registerEventUsageStats(DataServiceApplication.java:103)
2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err:     at com.meizu.dataservice.DataServiceApplication.onCreate(DataServiceApplication.java:61)
2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6923)
2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err:     at android.app.ActivityThread.access$1300(ActivityThread.java:260)
2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err:     at android.os.Looper.loop(Looper.java:223)
2021-11-20 12:33:01.974 16582-16582/com.meizu.dataservice W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:7955)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:603)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err: Caused by: java.lang.SecurityException: 
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at android.os.Parcel.createException(Parcel.java:2357)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at android.os.Parcel.readException(Parcel.java:2340)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at android.os.Parcel.readException(Parcel.java:2282)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at android.os.IServiceManager$Stub$Proxy.addService(IServiceManager.java:380)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:72)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at android.os.ServiceManager.addService(ServiceManager.java:197)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err:     at android.os.ServiceManager.addService(ServiceManager.java:166)
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice W/System.err: 	... 13 more
2021-11-20 12:33:01.975 16582-16582/com.meizu.dataservice D/DataServiceApplication: ### DataServiceApplication initFlymeNoVccUsageStats end
2021-11-20 12:33:01.980 16582-16582/com.meizu.dataservice E/DataServiceApplication: registerGpsReceiver
2021-11-20 12:33:01.980 16582-16582/com.meizu.dataservice D/DataServiceApplication: ### DataServiceApplication onCreate ###
java 复制代码
E/SELinux: avc:  denied  { add } 
for pid=16582 uid=1000 name=event_usagestats scontext=u:r:system_app:s0 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=0

分析上述Log语句:

缺少什么权限: { add }权限;
谁缺少权限: scontext=u:r:system_app:s0
对谁缺少权限: tcontext=u:object_r:default_android_service:s0
什么类型的操作: tclass=service_manager

缺少什么权限: { add }权限;

谁缺少权限:scontext=u:r:system_app:s0

对谁缺少权限:tcontext=u:object_r:default_android_service:s0

什么类型的操作:tclass=service_manager

{ add } system_app default_android_service service_manager

A B C D

allow system_app default_android_service service_manager { add }

B C D A

操作语句:

allow system_app default_android_service:service_manager { add }

相关推荐
_龙小鱼_1 小时前
Kotlin扩展简化Android动画开发
android·开发语言·kotlin
奔跑吧 android2 小时前
【android bluetooth 协议分析 01】【HCI 层介绍 6】【WriteLeHostSupport命令介绍】
android·bluetooth·bt·gd·aosp13·writelehostsup·hcicmd
uwvwko2 小时前
ctfshow——web入门254~258
android·前端·web·ctf·反序列化
顾子茵3 小时前
c++从入门到精通(六)--特殊工具与技术-完结篇
android·开发语言·c++
初遇你时动了情3 小时前
flutter 配置 安卓、Ios启动图
android·flutter·ios
YSoup4 小时前
Android Studio报错Cannot parse result path string:
android·android studio
zhangphil5 小时前
Android Coli 3 ImageView load two suit Bitmap thumb and formal,Kotlin(七)
android·kotlin
韩仔搭建7 小时前
安卓端互动娱乐房卡系统调试实录:从UI到协议的万字深拆(第一章)
android·ui·娱乐
limingade8 小时前
手机打电话时如何将通话对方的声音在手机上识别成文字
android·智能手机·语音识别·funasr·蓝牙电话·ai电话机器人·funasr安卓移植和部署