Access denied finding property “persist.vendor.log.tel_dbg”

六眼飞鱼酱① 提交于 2021-02-02 08:53:25

问题


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


回答1:


As show in screenshot:

logcat avd deined

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.



来源:https://stackoverflow.com/questions/59533551/access-denied-finding-property-persist-vendor-log-tel-dbg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!