• 主页
  • 随笔
所有文章 友链 关于我

  • 主页
  • 随笔

Android获取so来自那个依赖

2023-03-29

有时候开发过程中,需要知道那个so来自那个依赖,可以通过在app模块的gradle中插入下面代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
tasks.whenTaskAdded{ task->
// 换成自己对应的Flavors命令
if(task.name=="mergeXxxNativeLibs"){
task.doFirst{
it.inputs.files.each{file->
printSoDir(file)
}
}
}
}

def printSoDir(File file) {
if (file != null) {
if (file.isDirectory()) {
file.listFiles().each {
printSoDir(it)
}
} else if (file.absolutePath.endsWith(".so")) {
println("so file: $file.absolutePath")
}
}
}

其中的taskName是具体的自己项目对应run的时候对应的task,一般会与变种&BuildType有关。

  • Android
团队Git使用&统一代码格式
IM即时通讯数据加密方式
© 2023 liweijie
Hexo Theme Yilia
  • 所有文章
  • 友链
  • 关于我

tag:

  • Android
  • Jetpack
  • Java
  • Dart
  • OpenSource
  • MiniProgress
  • JavaScript
  • RN
  • 开发总结
  • Kotlin
  • 开发规范
  • IM
  • Java 设计模式

    缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    3、在根目录_config.yml里添加配置:

      jsonContent:
        meta: false
        pages: false
        posts:
          title: true
          date: true
          path: true
          text: false
          raw: false
          content: false
          slug: false
          updated: false
          comments: false
          link: false
          permalink: false
          excerpt: false
          categories: false
          tags: true
    

职业:移动开发者

Skill:Java,Kotlin,RN,Flutter