从Android应用Retreiving本土code结构 [英] Retreiving Native Code Architecture from an Android App

查看:302
本文介绍了从Android应用Retreiving本土code结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作这决定了本地code结构,并安装在设备上的所有应用程序使用的本地库的应用程序。它类似于运行以下命令。

I'm working on an app which determines the native code architecture and native libraries used by all the apps installed on the device. Its similar to running the following command.

 aapt dump badging <file.apk location>

包管理器不提供有关本地code这样的 之一或本机共享库。我可以检索本地共享库,目标应用程序具有以下code用途:

The package manager doesn't provide information about the native code like this one or the native shared libraries. I can retrieve the native shared libraries that the target app uses with the following code:

    try {
    Set<String> libs = new HashSet<String>();
    String mapsFile = "/proc/" + android.os.Process.myPid() + "/maps";
    BufferedReader reader = new BufferedReader(new FileReader(mapsFile));
    String line;
    while ((line = reader.readLine()) != null) {
        if (line.endsWith(".so")) {
            int n = line.lastIndexOf(" ");
            libs.add(line.substring(n + 1));
        }
    }
    Log.d("Ldd", libs.size() + " libraries:");
    for (String lib : libs) {
        Log.d("Ldd", lib);
    }
} catch (FileNotFoundException e) {
    // Do some error handling...
} catch (IOException e) {
    // Do some error handling...
}

我只要求是由应用程序包使用的本地code结构。我想确定从应用程序包兼容本地code结构。任何帮助吗?

All I require is the native code architecture used by the app package. I want to determine the compatible native code architecture from app package. Any help?

推荐答案

您还问如何获得通过软件包管理系统这一信息 - 这样看的回答这个帖子

You also asked how to get this info via the PackageManager - so see the answer to that post

这篇关于从Android应用Retreiving本土code结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆