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.

  • 相关阅读:
    Asp.net Core Kestrel 免费实现https
    sqlserver空间数据 + c# 实现查询附近的设备
    abp.vNext mvc版中的js和css
    asp.net core 3.x Identity
    asp.net core 3.x 授权默认流程
    Asp.Net WebApi 上传文件方法(原生js上传和JQ ajax上传)
    一个简单的.NET轻量级的ORM——Dikeko.ORM
    Mysql常见安装问题梳理(以5.6版本为例)
    Asp.netCore RESTful WebApi 小结
    初识Asp.netCore RESTful WebApi
  • 原文地址:https://www.cnblogs.com/jason207489550/p/6743409.html
Copyright © 2011-2022 走看看