zoukankan      html  css  js  c++  java
  • android7.0对于SharedPreferences设置模式的限制

    错误信息:

    03-28 10:16:12.701   830   932 E AndroidRuntime: FATAL EXCEPTION: Thread-9
    03-28 10:16:12.701   830   932 E AndroidRuntime: Process: com.solomo.azt, PID: 830
    03-28 10:16:12.701   830   932 E AndroidRuntime: java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at android.app.ContextImpl.checkMode(ContextImpl.java:2137)
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:354)
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:349)
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at com.baidu.android.pushservice.util.p.x(Unknown Source)
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at com.baidu.android.pushservice.util.p.v(Unknown Source)
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at com.baidu.android.pushservice.util.p.m(Unknown Source)
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at com.baidu.android.pushservice.util.p.l(Unknown Source)
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at com.baidu.android.pushservice.internal.PushManager.startWork(Unknown Source)
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at com.baidu.android.pushservice.apiproxy.BridgePushManager.startWork(Unknown Source)
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at com.baidu.android.pushservice.PushManager$40.run(Unknown Source)
    03-28 10:16:12.701   830   932 E AndroidRuntime:  at com.baidu.android.pushservice.LoadExecutor$1.run(Unknown Source)
    03-28 10:16:12.701  3691 17138 I ActivityManager: handleApplicationCrash callcom.solomo.azt

    关于此限制的说明:

    https://developer.android.com/reference/android/content/Context.html#MODE_WORLD_READABLE

    MODE_WORLD_READABLE

    This constant was deprecated in API level 17.

    Creating world-readable files is very dangerous, and likely to cause security holes in applications. It is strongly discouraged; instead, applications should use more formal mechanism for interactions such as ContentProviderBroadcastReceiver, and Service. There are no guarantees that this access mode will remain on a file, such as when it goes through a backup and restore.

    File creation mode: allow all other applications to have read access to the created file.

    As of N attempting to use this mode will throw a SecurityException.

  • 相关阅读:
    微信小程序路由跳转方式
    事务的隔离级别 乐观锁和悲观锁 f查询 q查询
    手机短信验证
    用git来操作项目
    git使用
    redis数据库 Python使用redis
    DRF框架:接口 ,restfui接口规范,基于restful规范的原生Django接口,Postman接口工具
    vue初识
    Win10玩游戏时听歌音量忽大忽小
    ASP.NET Core 2.0 WebApi全局配置及日志
  • 原文地址:https://www.cnblogs.com/jason207489550/p/6743409.html
Copyright © 2011-2022 走看看