How to search for a string in JAR files

后端 未结 10 1149
小蘑菇
小蘑菇 2020-12-12 14:57

My application is built on Java EE.

I have approximately 50 jars in this application.

Is it possible to search for a particular keyword (actually I want to s

10条回答
  •  醉话见心
    2020-12-12 15:37

    in android i had to search both jar and aar files for a certain string i was looking for here is my implementation on mac:

    find . -name "*.jar" -o -name "*.aar" | xargs -I{} zipgrep "AssestManager" {}
    

    essentially finds all jars and aar files in current direclty (and find command is recursive by default) pipes the results to zipgrep and applies each file name as a parameter via xargs. the brackets at the end tell xargs where to put the file name you got from the find command. if you want to search the entire home directory just change the find . to find ~

提交回复
热议问题