Last active
June 22, 2018 21:28
-
-
Save 3XclusiVe/b05015ac027cf9c3428cc8f6295bf327 to your computer and use it in GitHub Desktop.
find text pattern in all android manifests and aar files in folder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#usage: search_text_pattern_android_libs android.permission.WRITE_EXTERNAL_STORAGE | |
function recursiveSearchInAARs { | |
for file in *; do | |
if [ -d "$file" ]; then | |
(cd -- "$file" && recursiveSearchInAARs) | |
fi | |
#foreach file with extension .aar in folder recusevly | |
if [[ $file == *.aar ]]; then | |
if ( unzip -c "$file" | grep --color -Ri --include="*.xml" "$pattern"); then | |
echo $file | |
fi | |
fi | |
done | |
} | |
pattern="$1" | |
startSearchFolder=$(pwd) | |
grep --color -Ri --include="*.xml" "$pattern" "$startSearchFolder" | |
recursiveSearchInAARs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment