我是靠谱客的博主 合适长颈鹿,这篇文章主要介绍Android 9 pm命令执行流程调查,现在分享给大家,希望可以做个参考。

pm 可以执行程序

1|m891a:/ # which pm
/system/bin/pm
m891a:/ # cat /system/bin/pm
#!/system/bin/sh
cmd package "$@"
m891a:/ # 

源码位置:AOSP/frameworks/base/cmds/*
cmd文件位置:AOSP/frameworks/native/cmds/cmd/cmd.cpp

if ((argc == 2) && (strcmp(argv[1], "-l") == 0)) {
        Vector<String16> services = sm->listServices();
        services.sort(sort_func);
        aout << "Currently running services:" << endl;
        for (size_t i=0; i<services.size(); i++) {
            sp<IBinder> service = sm->checkService(services[i]);
            if (service != NULL) {
                aout << "  " << services[i] << endl;
            }
        }
        return 0;
    }

可以使用cmd -l列出所有服务
接下来会调用Package manager (package) commands

127|m891a:/ # cmd package                                                                                                                                                                                  
Package manager (package) commands:
  help
    Print this help text.

  path [--user USER_ID] PACKAGE
    Print the path to the .apk of the given PACKAGE.

  dump PACKAGE
    Print various system state associated with the given PACKAGE.

  list features
    Prints all features of the system.
   ......

最后

以上就是合适长颈鹿最近收集整理的关于Android 9 pm命令执行流程调查的全部内容,更多相关Android内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(137)

评论列表共有 0 条评论

立即
投稿
返回
顶部