zoukankan      html  css  js  c++  java
  • android7.0后对于detected problems with app native libraries提示框显示

    log信息:

    03-27 09:08:25.887   397   400 W linker  : /data/app/com.guagua.qiqi-1/lib/arm/libMedia.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
    03-27 09:08:26.807   397   400 W linker  : /data/app/com.guagua.qiqi-1/lib/arm/libMedia.so has text relocations. This is wasting memory and prevents security hardening. Please fix.

    此log信息在android早期版本也会存在,但是在UI上不会有任何提示。

    在7.0和7.1有新加如下的code:

    /frameworks/base/core/java/android/app/Activity.java

    final void performStart(){
    ...
    6689
    6690        // This property is set for all builds except final release
    6691        boolean isDlwarningEnabled = SystemProperties.getInt("ro.bionic.ld.warning", 0) == 1;
    6692        boolean isAppDebuggable =
    6693                (mApplication.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
    6694
    6695        if (isAppDebuggable || isDlwarningEnabled) {
    6696            String dlwarning = getDlWarning();
    6697            if (dlwarning != null) {
    6698                String appName = getApplicationInfo().loadLabel(getPackageManager())
    6699                        .toString();
    6700                String warning = "Detected problems with app native libraries
    " +
    6701                                 "(please consult log for detail):
    " + dlwarning;
    6702                if (isAppDebuggable) {
    6703                      new AlertDialog.Builder(this).
    6704                          setTitle(appName).
    6705                          setMessage(warning).
    6706                          setPositiveButton(android.R.string.ok, null).
    6707                          setCancelable(false).
    6708                          show();
    6709                } else {
    6710                    Toast.makeText(this, appName + "
    " + warning, Toast.LENGTH_LONG).show();
    6711                }
    6712            }
    6713        }

    对于有dlwarning的app,如果此app是debuggable模式或系统ro.bionic.ld.warning属性为1,那么会给app提示(以对话框的方式),需要完善或优化so库。

  • 相关阅读:
    结语
    创建ejs模板的express工程
    浏览器控制台命令调试——console
    JS获取URL中参数值(QueryString)的4种方法分享
    oracle之报错:ORA-00054: 资源正忙,要求指定 NOWAIT
    javascript 获取页面的高度及滚动条的位置的代码
    javascript 页面各种高度宽度
    导出Excel之Epplus使用教程2(样式设置)
    索引 'GXHRCS.PK_A253' 或这类索引的分区处于不可用状态
    数据库操作
  • 原文地址:https://www.cnblogs.com/jason207489550/p/6743486.html
Copyright © 2011-2022 走看看