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库。

  • 相关阅读:
    ESP8266型号对比
    Arduino安装ESP8266开发库
    ESP8266驱动I2C OLED显示屏
    爬虫与反爬技术汇总
    爬虫之爬取某道技术分析
    爬虫之12306模拟登陆和购票
    web开发之用户单点登陆和多用户登陆实现
    爬虫中如何获取图片验证码
    web开发中图片保存问题
    python的缓存机制
  • 原文地址:https://www.cnblogs.com/jason207489550/p/6743486.html
Copyright © 2011-2022 走看看