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.

  • 相关阅读:
    [bzoj] 2565 最长双回文串
    [codeforces] 17E Palisection
    luogu P3267 [JLOI2016/SHOI2016] 侦查守卫
    181020-181021 模拟 题解
    luogu P2571 [SCOI2010]传送带
    poj1064 Cable master
    poj1422 Air Raid
    luogu P2512 [HAOI2008]糖果传递
    CF549H Degenerate Matrix
    左偏树基础教学
  • 原文地址:https://www.cnblogs.com/jason207489550/p/6743409.html
Copyright © 2011-2022 走看看