访问被拒绝,无法找到属性"persist.vendor.log.tel_dbg"; [英] Access denied finding property "persist.vendor.log.tel_dbg"

查看:1014
本文介绍了访问被拒绝,无法找到属性"persist.vendor.log.tel_dbg";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试显示从开放天气地图api中提取的Json数据,并在logcat中找到它.成功构建和安装应用程序之后.我收到此错误.错误是Access拒绝找到属性"persist.vendor".log.tel_dbg"

 公共类MainActivity扩展了AppCompatActivity {EditText mEditText;TextView mTextView;字符串api ="http://api.openweathermap.org/data/2.5/weather?q = kolkata& appid = e8cd0e5f8d3ba1e87d108da87d9c0a94;@Override受保护的void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);DownloadTask task = new DownloadTask();task.execute(api);}公共类DownloadTask扩展了AsyncTask< String,Void,String>{@Override受保护的字符串doInBackground(String ... urls){字符串result =";网址url;HttpURLConnection urlConnection = null;尝试 {url =新URL(urls [0]);urlConnection =(HttpURLConnection)url.openConnection();InputStream in = urlConnection.getInputStream();InputStreamReader reader = new InputStreamReader(in);int data = reader.read();一会儿(数据!=-1){char current =(char)data;结果+ =当前;data = reader.read();}} catch(MalformedURLException e){e.printStackTrace();} catch(IOException e){e.printStackTrace();}返回结果;}@Override受保护的void onPostExecute(字符串结果){super.onPostExecute(result);Log.i("Result",result);}}} 

使用 audit2allow 也许可以修复它.

I am trying to display Json data extracted from open weather map api and find it in the logcat.After successful build and installation of the app.I am getting this error.The error is Access denied finding property "persist.vendor.log.tel_dbg"

public class MainActivity extends AppCompatActivity {

EditText mEditText;
TextView mTextView;
String api="http://api.openweathermap.org/data/2.5/weather? 
q=kolkata&appid=e8cd0e5f8d3ba1e87d108da87d9c0a94";
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    DownloadTask task=new DownloadTask();
    task.execute(api);
}
public class DownloadTask extends AsyncTask<String,Void,String>
{
    @Override
    protected String doInBackground(String... urls) {
        String result="";
        URL url;
        HttpURLConnection urlConnection=null;
        try {
            url=new URL(urls[0]);
            urlConnection=(HttpURLConnection)url.openConnection();
            InputStream in=urlConnection.getInputStream();
            InputStreamReader reader=new InputStreamReader(in);
            int data=reader.read();
            while (data!=-1)
            {
                char current=(char)data;
                result+=current;
                data=reader.read();
            }

        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }
    @Override
    protected void onPostExecute(String result) {
        super.onPostExecute(result);
        Log.i("Result",result);
      }
   }

}

Image of Logcat

解决方案

As show in screenshot:

before error log

Access denied finding property "persist.vendor.log.tel_dbg"

there is another warning:

type=1400 audit(xxx): avc: denied { read } for xxx

which is the reason for above error Access denied finding property

Example to show the root cause of Access denied finding property

I encount similar error:

com.gsma.rcs W/com.gsma.rcs: type=1400 audit(0.0:526384): avc: denied { read } for name="u:object_r:vendor_displayfeature_prop:s0" dev="tmpfs" ino=16384 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:vendor_displayfeature_prop:s0 tclass=file permissive=0

Exapnation:

  • Actionread
  • Actor=scontext=source contextuntrusted_app_25
  • Object=tcontext=target contextvendor_displayfeature_prop
    • Note:
      • corresponding later: ro.vendor.df.effect.conflict
      • object_r=object read
  • Result=tclass=target classfile
  • permissive=permissive mode0
    • 0 permissive:not allow = denied
    • background:
      • selinux has two mode:
        • permissive mode
        • enforcing mode
      • during Android device booting, you can use kernel parameter to config mode:
        • androidboot.selinux=permissive
        • or
        • androidboot.selinux=enforcing

Translate to human readable words:

the untrusted_app_25 want to read the vendor_displayfeature_prop, which type is file but due to NOT permissive mode, Android SELinux denied (according to OEM built-in configuration of SELinux)

which cause the following output error log:

com.gsma.rcs E/libc: Access denied finding property "ro.vendor.df.effect.conflict"

How to fix avc: denied error ?

refer official doc:

Validating SELinux | Android Open Source Project

use audit2allow maybe can fix it.

这篇关于访问被拒绝,无法找到属性"persist.vendor.log.tel_dbg";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆